I'm trying to uase a macro to name worksheets based on a name entered in a cell on the worksheet. My macro looks like this:
Sub Worksheet_Name()
Worksheets("Base"
.Name = Range("K1"
Worksheets("1st Quarter"
.Name = Range("K1"
& " 1st Quarter"
Worksheets("2nd Quarter"
.Name = Range("K1"
& " 2nd Quarter"
Worksheets("3rd Quarter"
.Name = Range("K1"
& " 3rd Quarter"
Worksheets("4th Quarter"
.Name = Range("K1"
& " 4th Quarter"
End Sub
It works for the first four worksheets, but then gives me run-time 9 error, subscript out of range on the fifth worksheet. What's my problem and how can I correct it?
Thanks,
jnix
Sub Worksheet_Name()
Worksheets("Base"
Worksheets("1st Quarter"
Worksheets("2nd Quarter"
Worksheets("3rd Quarter"
Worksheets("4th Quarter"
End Sub
It works for the first four worksheets, but then gives me run-time 9 error, subscript out of range on the fifth worksheet. What's my problem and how can I correct it?
Thanks,
jnix