Naming Spreadsheet Tabs

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

Guest

Hi all you Excel gurus out there --

Is there a way to have a spreadsheet tab automatically name itself based on
a cell within the the sheet?

Thanks for your help.

Ellen
 
Ellen

Only by using code. You could use a Worksheet_Change() event, like so

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1")) Is Nothing Then
Me.Name = Target.Value
End If
End Sub

It has no checking if the name has illegal characters though, is too long
etc.

To implement in a sheet right click the tab and select view code. paste it
there and close the VBE, now if you make a change in A1 on that sheet it
will change the name of the sheet tab



--

HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
web: www.nickhodge.co.uk
blog (non tech): www.nickhodge.co.uk/blog
 
you would need a macro to do that either in a worksheet_change event or a
macro
If a date you will have to use an acceptable format.

activesheet.name=range("a1").value
 
No. You can only rename the Worksheet tab by double-clicking. However, if you
are familiar with the VBA programming buit into Microsoft Excel, then you
could write few lines of code for that behaviour.

Challa Prabhu
 
Back
Top