Automatic naming of worksheets

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

Guest

I have a cell which automatically calculates the date for the work sheet. Is is possible to have the worksheet tabs automatically change to the same date as is in the cell, such that when I change the date in the associated cell on the first page, that all the tabs update to reflect the newly calculated date in their corresponding cell?

I have been manually renaming each sheet, and while is is not that big a deal, having an automatic function would simplify annual updates.

Thank you for your time.
 
One way:

Assume dates in cell A1 for each worksheet.

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
Dim wkSht As Worksheet
On Error Resume Next
For Each wkSht In Worksheets
With wkSht
If .Range("A1").Text <> .Name Then _
.Name = .Range("A1").Text
End With
Next wkSht
On Error GoTo 0
End Sub

Put this in the ThisWorkbook code module (right-click on the
workbook title bar, choose View Code, paste the following in the
window that opens, then click the XL icon on the toolbar to return
to XL).
 
Back
Top