tabname=A2 (part2)

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

Jean-Paul De Winter

Thanks for the help... but alas..this doesn't seem to work...
I entered everything you wrote into the VB editor... but when I change
the content of A2 the tab-value doens't change...
I probably did something wrong...

(BTW the puchbutton works perfect... saves me a lot of "clicking")

Thanks again
JP

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
 
Hi
this code has to go into the worksheet module, not in a standard
module. try the following:
- open your workbook
- right-click on the tab name and choose code
- paste the code in the appearing VBA editor window
- close the VBA editor, save the workbook and try again
 
Hi!

Frank's code (literally copied and pasted from the post) worked firs
time for me. Where did you put it and could there be a transcriptio
error?

Al
 
Back
Top