Thread: naming tabs
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Paul B
 
Posts: n/a
Default naming tabs

Jeff,
To put in this macro right click on the worksheet tab and view code, in the
window that opens paste this code, press Alt and Q to close this window and
go back to your workbook. If you are using excel 2000 or newer you may have
to change the macro security settings to get the macro to run. To change the
security settings go to tools, macro, security, security level and set it to
medium

The code that was posted will work if your sheet is the first sheet in the
workbook, if not you may want to try this

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
If Target.Value < "" Then
On Error Resume Next
ActiveSheet.Name = Target.Value
On Error GoTo 0
End If
End If

End Sub



--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Jeff" wrote in message
...
wrote:
The following will work for Sheet1 with the tab name in cell A1.

Paste the following code into the code section of Sheet1:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
sName = Sheets(1).Range("A1")
If sName = "" Then sName = "Sheet1"
Sheets(1).Name = sName
End Sub

excuse my ignorance but what do you mean by "code section"