Tab name = cell value?

G

Guest

Any way to import a tab name into a cell such that the cell text is the same
as the tab?

(Tab name = Project ABC, and I'd like to automatically set cell B2 to
"Project ABC")

Allan
 
G

Guest

Try this:

B2: =MID(CELL("filename"),SEARCH("]",CELL("filename"))+1,255)

Does that help?
***********
Regards,
Ron

XL2003, WinXP
 
B

Bernard Liengme

This will work only if the file has been saved
=MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)
best wishes
 
R

Roger Govier

Hi Al

Try
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)


The file must be saved first.
 
D

David Biddulph

=RIGHT(CELL("filename"),LEN(CELL("filename"))-FIND("]",CELL("filename")))
 
G

Guest

These both work...many thanks to you. I'm now reading up on MID and FIND
functions, but could you please explain what your functions are actually
doing. Thanks in advance!

Bernard Liengme said:
This will work only if the file has been saved
=MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

Al said:
Any way to import a tab name into a cell such that the cell text is the
same
as the tab?

(Tab name = Project ABC, and I'd like to automatically set cell B2 to
"Project ABC")

Allan
 
G

Guest

=MID(CELL("filename"),FIND("]",CELL("filename"),1)+1,99)

Vaya con Dios,
Chuck, CABGx3
 
G

Guest

Type the formula =CELL("FILENAME"), OR =CELL("FILENAME",A1) in a cell and see
that it returns the entire PATH, Workbook name, and sheet name. The formula
sees this string each time those terms are used in it. Essentially the
formula says to find the closing bracket symbol "]", skip over it, and return
the rest of the characters in the string (ie: the sheetname)

hth
Vaya con Dios,
Chuck, CABGx3



CLR said:
=MID(CELL("filename"),FIND("]",CELL("filename"),1)+1,99)

Vaya con Dios,
Chuck, CABGx3



Al said:
Any way to import a tab name into a cell such that the cell text is the same
as the tab?

(Tab name = Project ABC, and I'd like to automatically set cell B2 to
"Project ABC")

Allan
 
D

David Biddulph

If you want to find out what an Excel function does, put the function name
into Excel's help. It will tell you the syntax, show examples, and often
cross-refer to related functions too.
--
David Biddulph

Al said:
These both work...many thanks to you. I'm now reading up on MID and FIND
functions, but could you please explain what your functions are actually
doing. Thanks in advance!
Bernard Liengme said:
This will work only if the file has been saved
=MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)
best wishes
Al said:
Any way to import a tab name into a cell such that the cell text is the
same
as the tab?

(Tab name = Project ABC, and I'd like to automatically set cell B2 to
"Project ABC")

Allan
 
D

David Biddulph

Or (more robustly)
=RIGHT(CELL("filename",A1),LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1)))--David Biddulph"David Biddulph" <groups [at] biddulph.org.uk> wrote in messagenews:[email protected]...> =RIGHT(CELL("filename"),LEN(CELL("filename"))-FIND("]",CELL("filename")))> "Al" <[email protected]> wrote in messageAny way to import a tab name into a cell such that the cell text is thesame>> as the tab?>>>> (Tab name = Project ABC, and I'd like to automatically set cell B2 to>> "Project ABC")>>>> Allan
 
D

Dave Peterson

Be careful with the formulas that didn't include a reference to a cell in the
sheet.

=CELL("filename")

will return the name of the workbook that is active when excel recalcs. If you
open two different workbooks and arrang windows so you can a worksheet from each
workbook and put that =CELL("filename") in a cell in each workbook, you'll see
the problem.

In this case, you'd want to include a reference to the worksheet that contains
the formula. You can use:

=CELL("filename",a1)
or even use the cell that contains the formula.
 
G

Guest

Good point Dave............I keep forgetting that......probably I need to
increase the strength of my medication <g>

Vaya con Dios,
Chuck, CABGx3
 
D

Dave Peterson

Or reduce it <vbg>????
Good point Dave............I keep forgetting that......probably I need to
increase the strength of my medication <g>

Vaya con Dios,
Chuck, CABGx3
 
G

Guest

Thanks for the explanation...reading the HELP doesn't "explain" what's going
Type the formula =CELL("FILENAME"), OR =CELL("FILENAME",A1) in a cell and see
that it returns the entire PATH, Workbook name, and sheet name. The formula
sees this string each time those terms are used in it. Essentially the
formula says to find the closing bracket symbol "]", skip over it, and return
the rest of the characters in the string (ie: the sheetname)

hth
Vaya con Dios,
Chuck, CABGx3



CLR said:
=MID(CELL("filename"),FIND("]",CELL("filename"),1)+1,99)

Vaya con Dios,
Chuck, CABGx3



Al said:
Any way to import a tab name into a cell such that the cell text is the same
as the tab?

(Tab name = Project ABC, and I'd like to automatically set cell B2 to
"Project ABC")

Allan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top