View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PCLIVE PCLIVE is offline
external usenet poster
 
Posts: 1,311
Default automatically change worksheet tab name

This will need to be done using VBA.

Press Alt+F11 to enter the VB Editor.
On the left, you should see your workbook listed as
"VBAProject(YourWorkbook)". If there is a plus to the left of it, click it
to make it a minus which expands the list as well. Do the same thing for
"Microsoft Excel Objects".
Double-click on ThisWorkbook.
Paste the following code in the right-hand pane.


Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Stop
If ActiveSheet.Name = "Data" And Sheets(Target.Row).Name < "Data" _
Then
If Target.Column = 1 And Target.Value < "" Then
Sheets(Target.Row).Name = Target.Value
Else
End If
End Sub


HTH,
Paul


--

"wally" wrote in message
...
I have 16 sheets that are numbered 1 thru 16 on the tab. I also have a
17th sheet I have renamed "Data" (ignore quotes). I would like to type
a name, (i.e., wonder) into cell a1 of the Data sheet and have that
automatically change the name of sheet number 1 to "wonder". Then I
would type another name (i.e., Hanger) into on the data sheet into
cell a2 and that would change sheet number 2 to Hanger. I would
continue to do this until all sheets are now changed to a name rather
than a numer. Can this be accomplished by a formula?
Thank you, Wally