Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Worksheet Names From Cell

Status
Not open for further replies.

EBox

Programmer
Joined
Dec 5, 2001
Messages
70
Location
US
Is there a way to name an Excel worksheet tab with the contents of a particular cell within that tab? For example, whatever is in cell A1 would be the name that appears on that tab?

Any help is appreciated.

Thanks,
EBox
 
Sub Set_Name()
shname = [a1].Value
ActiveSheet.Name = shname
End Sub

Regards, Dale Watson
 
If the workbook has been previously saved, you can use the CELL function to return the path, filename & sheet name. This information can then be parsed to get the sheet name.
=MID(CELL("filename",A1),FIND("]",CELL("filename"),A1)+1,99)
In this formula, the reference to cell A1 is arbitrary--it could be any cell on the worksheet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top