View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Big Rick
 
Posts: n/a
Default Tab Names Changes

Hello to all my good friends out there.

I have the following code in my worksheet.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "j3"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Me.Name = Target.Value
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

Which will alter the tab name of the worksheet with whatever is in cell J3.
If however the contents of j3 changes, the tab name doesn't change. Not when
I press f9, even though calculation is set to auto and doesn't even change
when saving and reopening the workbook. The only way it does change is when I
click on the cell itself and press enter again.
Is there a way to have the tab name change immediately after the cell change.

eg. j2 = 5/3/1999
j3 = =TEXT(J2,"dd mm")

When j2 changes the tab name doesn't change until I click on J3 and press
enter.

Your help is and always has been very much appreciated.
Thanking you in anticipation.

Regards
--
Big Rick