VBA code to populate Excel Tab Text

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to use VBA to enter tab's name in Excel's worksheet tab from a
cell in the worksheet. Lets say I have the word "Mickey Mouse" in cell A1 in
my worksheet. I would like to auto populate the worksheet's tab to show
Mickey Mouse. Any help here?
 
you don't really need the activesheet.name when you use with activesheet.

one or the other will do

Sub test()
With ActiveSheet
.Name = Range("A1").Value
End With
End Sub

or

Sub test2()
ActiveSheet.Name = Range("A1").Value
End Sub


--


Gary


Charlie_Brown said:
This was exactly what I was looking for.
Thank you for your quick response!

Incidental said:
Hi CB

this should work

With ActiveSheet
ActiveSheet.Name = [A1]
End With

S
 
Back
Top