Macro forr Worksheet names

  • Thread starter Thread starter Jim
  • Start date Start date
Jim

You need a macro.

Sub SheetName()
ActiveSheet.Name = Range("c1")
End Sub

Gord Dibben Excel MVP
 
Hi
and if you want to automatically change the tab name if you change the
cell value put the following code in your worksheet module (not in a
standard module):

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
application.enableevents = false
With Target
If .Value <> "" Then
Me.Name = .value
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub
 
Back
Top