View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Automatically name worksheet tab w/cell formula

Hi Bill
this requieres VBA. You could use the worksheet_change event. E.g. the
following code will change the tab name based of the value in cell A1.
Put this in your worksheet 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:
With Target
If .Value < "" Then
Me.Name = .Value
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany

Bill B wrote:
I would like to be able to automatically name my worksheet
tabs.

Is there a cell formula or macro that I can use so that:

If: The contents of cell A1 is 'January 1, 2004'
Then: The worksheet tab automatically is changed to
'January 1, 2004'

Also, can anyone recommend books on VB programming
(beginner level) for Excel?

Thanks,

Bill