Viewing 4 posts - 1 through 4 (of 4 total)
  • Excel help – renaming worksheet tabs after a dates in cell
  • winston_dog
    Free Member

    Hi

    I have a workbook which contains 52 worksheets, 1 per week, for a whole year, 1 week = 1 sheet.
    Each sheet has a title for the week ending date.
    I would like to avoid having to manually change the name on each sheet.
    Is it possible to link the name of each sheet with the title cell on the worksheet, so the tabs along the bottom clearly show the corresponding week?
    Many thanks.

    5lab
    Full Member

    excel macro would be able to do this.

    mossimus
    Free Member

    Sub dothis()
    For i = 1 To Sheets.Count
    Sheets(i).Name = Worksheets(i).Range(“A1”).Value
    Next
    End Sub

    Should work: Change A1 to your title cell.

    You might want to add some code to check for Null values

    bikebouy
    Free Member

    Yup VBA wil cure this. You’ll need to amke a cell in one of your sheets the referance cell so the code can pick it up.
    Do something in each tab “right click, view code”

    Sub changetabname()
    Dim WsName As String

    With ActiveSheet
    WsName = .Name
    End With

    ‘ or this >> Sheets(“Sheet1”).Name = Left$(Sheets(“Sheet1”).Range(“A1”).Value,12)

    * or this >> Sheets(WsName).Name = “add your report name here”

    End Sub

    Note, where Range(“A1”) = the cell referance where you want to pick up the tab name from, could be anywhere, but you mentioned dates, could be a good cell ref for the date, but you choose that

    End (help!! haahahahaah)

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Excel help – renaming worksheet tabs after a dates in cell’ is closed to new replies.