J
Jeff
is there a simple way to have a tab on a worksheet the same as text in a
cell on that sheet ??
cell on that sheet ??
excuse my ignorance but what do you mean by "code section"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
Thanks very much that was great just what I needed to do.Click on Tools - Macro - Visual Basic Editor
On the left should be a VBAProject Window. Expand the items listed
until you see Sheet1 (Sheet1). Double Click on Sheet1. A VBA Code
Window will open for Sheet1.
I hope this will help get you started.
Paul, this also works well thank you, can you advise me of a way ofPaul said: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