Hi,
I am trying to rename my worksheets (540 of them) based on the value in cell A200 (which is a formula pulling together 3 cells, so =A1&" "&B1&" "&A3 ). I've checked all the sheets to make sure there is a value in cell A200. However, when I run the below macro, I get a Run-time error.
VBA used
Sub test()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Activate
ActiveSheet.Name = Range("A200").Value
Next ws
End Sub
Error received when VBA used
Run-time error '1004':
Application-defined or object-defined error
Can anyone help/advise?
I am trying to rename my worksheets (540 of them) based on the value in cell A200 (which is a formula pulling together 3 cells, so =A1&" "&B1&" "&A3 ). I've checked all the sheets to make sure there is a value in cell A200. However, when I run the below macro, I get a Run-time error.
VBA used
Sub test()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Activate
ActiveSheet.Name = Range("A200").Value
Next ws
End Sub
Error received when VBA used
Run-time error '1004':
Application-defined or object-defined error
Can anyone help/advise?