Code:
Dim ws As Worksheets
For Each ws In Worksheets
For z = 2 to 26
[COLOR=#ff0000]If ws.Name <> "Template" And "Rota" Then[/COLOR]
ws.Name = Cells(1, z)
End If
Next
Next
The red is the offending line. All I'm trying to do is rename each worksheet after each cell in B1:Z1 (There is the same no. Of corresponding worksheets). Any ideas what I'm missing?
Thank you in advance for your help
Last edited: