Can cell get tab value

W

Wally

Can a cell show the worksheet tab value?

My worksheet tab and my title cell in my worksheet must have the same
value. can one read the other so I only have to input the information
once?

Thanks

Wally
 
D

David McRitchie

Hi Wally,
See my http://www.mvps.org/dmcritchie/excel/sheets.htm
page for questions on sheets
see my http://www.mvps.org/dmcritchie/excel/pathname.htm
page for questions on extracting pathname, workbook name, sheetname

VBA cell value gets worksheet tab value
range("a1") = application.activesheet.name

VBA worksheet tab gets cell value
ActiveSheet.Name = Range("a1")

you might also be interested in formatting with a date (with or w/o the prefix)
ActiveSheet.Name = "D" & Format(Date, "yyyymmdd")
ActiveSheet.Name = "D" & Format(Range("a1"), "yyyymmdd")
ActiveSheet.Name = "D" & Format(Range("a1"), "yyyy_mmdd_hhmm")

worksheet function cell value gets worksheet tab value
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
« The CELL formulas with "filename" will not work until the file has been saved (#VALUE! error).
 
D

David McRitchie

and since you don't care which you change, you should be
changing the sheetname, because you can't have two sheets
with the same name so that would be the easiest way to go
and not have to worry about intercepting errors.
 
Top