Subscribe now and choose from over 30 free gifts worth up to £49 - Plus get £25 to spend in our shop
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.
excel macro would be able to do this.
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
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)
