Rename Worksheet Tabs per Cell Content
From Ron de Bruin comes this code.
Sub Sheetname_cell()
Dim sh As Worksheet
Application.ScreenUpdating = False
For Each sh In ThisWorkbook.Worksheets
On Error Resume Next
sh.Name = sh.Range("A1").Value
'next lines cover duplicate names
If Err.Number 0 Then
MsgBox "Change the name of : " & sh.Name & " manually"
Err.Clear
End If
On Error GoTo 0
Next
Application.ScreenUpdating = True
End Sub
Gord Dibben MS Excel MVP
On Tue, 15 May 2007 09:52:01 -0700, JEFF wrote:
Hello,
I'd like to be able to rename my worksheet tabs based on the contents of a
cell within that worksheet (same cell in each worksheet).
Any suggestions? TIA
|