Tab naming

  • Thread starter Thread starter David Aides
  • Start date Start date
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
 
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)
 
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
 
Is there anyway to have a cell value display the name of the tab it is
located in?
 
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)
 
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.
 

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

Back
Top