+ Reply to Thread
Results 1 to 5 of 5

Change sheet tab names by changing cell value

  1. #1
    Registered User
    Join Date
    08-10-2006
    Location
    Oakland
    Posts
    38

    Change sheet tab names by changing cell value

    I want to have a sheet tab name be automatically changed to the value in a cell on that sheet. For example, if A1 value is Jan 07, then the sheet tab name would be Jan 07. If I change A1 to Feb 07, then the tab name would change.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Try this

    Right click sheet tab and select view code. Paste the below in and close

    Please Login or Register  to view this content.
    Format cell as Text

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    08-10-2006
    Location
    Oakland
    Posts
    38

    Change sheet name

    Thanks. It works but with a little glitch.
    After entering the code, I have to F2 cell A1 and then "enter" for it to take.
    But thereafter it works OK. I guess it needs an "enter" for it to take.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    I used a change event which need the cell activated.

    You could try one of the events on the below link like

    Please Login or Register  to view this content.
    http://www.cpearson.com/excel/events.htm

    VBA Noob

  5. #5
    Registered User
    Join Date
    01-15-2015
    Location
    London
    MS-Off Ver
    7
    Posts
    32

    Re: Change sheet tab names by changing cell value

    Hi There,

    I have a code below, I have a file with the first page being the summary and I need the rest of the tab names to be changed according to one cell K2 reference that are referencing in all the tab names so the Date for example is in cell K2 in every tab, and I need the tab name to reflect K2 changed.



    Private Sub CommandButton1_Click()

    End Sub

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    ActiveSheet.Name = Range("K2").Value
    Sheet2.Name = Range("K2").Value
    Sheet3.Name = Range("K2").Value
    Sheet4.Name = Range("K2").Value
    Sheet5.Name = Range("K2").Value
    Sheet6.Name = Range("K2").Value
    Sheet7.Name = Range("K2").Value
    Sheet8.Name = Range("K2").Value
    Sheet9.Name = Range("K2").Value
    Sheet10.Name = Range("K2").Value
    Sheet11.Name = Range("K2").Value
    Sheet12.Name = Range("K2").Value



    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1