tabname=A2

  • Thread starter Jean-Paul De Winter
  • Start date
J

Jean-Paul De Winter

Hi,
Can I automatically give the tab of the current worksheet give the
value of (let's say) cell A2...
ex. I enter a value in cell A2 and the tab-name is changed whenever I
change the value of A2.

Sorry I can't reply to your answers due to some OE problems...

Thanks you all so much
JP
 
F

Frank Kabel

Hi
you'll need VBA for this(an event procedure: see
http://www.cpearson.com/excel/events.htm for more details): Put the
following code 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("A2")) 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
 
Top