Hi All
I'm trying to get a button to apply the contents of A1 to the tab name on every sheet, (if that makes sense?)
I was using this code successfully on some other similar spreadsheets but now it simply won't work. I am getting this error "Run-time error '1004': Method 'Name' of object' _Worksheet' failed
The code I am using is below.
Thanks as always for your help.
Sub myTabNames()
Dim ws As Worksheet
For Each ws in ActiveWorkbook.Worksheets
ws.Name = ws.Range("A1").Value
Next
End Sub
I'm trying to get a button to apply the contents of A1 to the tab name on every sheet, (if that makes sense?)
I was using this code successfully on some other similar spreadsheets but now it simply won't work. I am getting this error "Run-time error '1004': Method 'Name' of object' _Worksheet' failed
The code I am using is below.
Thanks as always for your help.
Sub myTabNames()
Dim ws As Worksheet
For Each ws in ActiveWorkbook.Worksheets
ws.Name = ws.Range("A1").Value
Next
End Sub