Hi All,
I'm looking for some assistance with modifying this code.
I would like to exclude a few sheets from the loop. Specifically the sheets code "Sheet1" "Sheet7" and "Sheet8" this is the code identifier not sheet name.
Any help or direction would be appreciated thanks.
I'm looking for some assistance with modifying this code.
I would like to exclude a few sheets from the loop. Specifically the sheets code "Sheet1" "Sheet7" and "Sheet8" this is the code identifier not sheet name.
Any help or direction would be appreciated thanks.
VBA Code:
Sub tabname()
Dim ws As Worksheet
For Each ws In Worksheets
On Error Resume Next
If Len(ws.Range("B17")) > 0 Then
ws.Name = ws.Range("B17").Value
End If
On Error GoTo 0
If ws.Name <> ws.Range("B17").Value Then
MsgBox ws.Name & " Was Not renamed, the suggested name was invalid"
End If
Next
End Sub