D
des-sa
please help
how do i give a tab of a worksheet the same name as a cell in the worksheet,
automatically
how do i give a tab of a worksheet the same name as a cell in the worksheet,
automatically
Rick Rothstein (MVP - VB) said:You will need to use worksheet event code to do that. Right-click the
worksheet's tab and select View Code from the popup menu that appears, then
copy/paste this code into the code window that appeared...
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then ActiveSheet.Name = Target.Value
End Sub
Change the reference to "$A$1" to the absolute address of the cell you
actually want to use. Then, whenever you change the text in that cell, the
worksheet tab will be changed to whatever you typed into it.
Rick
Rick Rothstein (MVP - VB) said:You will need to use worksheet event code to do that. Right-click the
worksheet's tab and select View Code from the popup menu that appears, then
copy/paste this code into the code window that appeared...
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then ActiveSheet.Name = Target.Value
End Sub
Change the reference to "$A$1" to the absolute address of the cell you
actually want to use. Then, whenever you change the text in that cell, the
worksheet tab will be changed to whatever you typed into it.
Rick
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.