Tab naming

D

David Aides

I would like for a workbook sheet tabs (excel 2000) to
automatically re-name themselves from what the sheets "C2"
cell contains.

TFTH,
David
 
B

Bob Phillips

For Each sh In Activeworkbook.Worksheets
sh.Name = sh.Range("C2").Value
Next sh

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
D

David Aides

Bob,
Forgive me for not being as good with Excel as I would
like to be, but when I put this code in my workbook VB it
did not work. Please elaborate on how I should do so.

TFTH
 
M

martialtiger

Is there anyway to have a cell value display the name of the tab it is
located in?
 
I

icestationzbra

these will display the sheetname (if that is what you meant by tab
name).

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

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

this will display the filename along with the path and sheetname.

=CELL("filename")

this will display only the path of the file.

=MID(CELL("filename"),1,(FIND("[",CELL("filename")))-2)
 
D

David McRitchie

three of the four formulas you posted are incorrect because they do not
have a reference cell. Please read the large italic indented text near the
beginning of
Pathname in headings, footers, and cells
http://www.mvps.org/dmcritchie/excel/pathname.htm

Without the reference cell you will pick up the worksheet that was active
dure the last time that calculation took place. That worksheet might
even be in another workbook.
 
Top