L
lance-news
Hello
I am trying to loop through the Worksheets and rename the various
worksheets based on the name in Cell A1. The below script will rename
the first sheet "Means" but then I get an error
"Cannot rename a sheet to the same name as another sheet"
What is wrong with my script?
Sub A0Rename()
For Each sh In Worksheets
If ActiveSheet.Cells(1, 1).Value = "Descriptives" Then sh.Name = "Means"
If ActiveSheet.Cells(1, 1).Value = "ANOVA" Then sh.Name = "ANOVA"
If ActiveSheet.Cells(1, 1).Value = "Test of Homogeneity of Variances"_
Then sh.Name = "HOV"
If ActiveSheet.Cells(1, 1).Value = "Multiple Comparisons" Then sh.Name_
= "Pairwise"
Next sh
I am trying to loop through the Worksheets and rename the various
worksheets based on the name in Cell A1. The below script will rename
the first sheet "Means" but then I get an error
"Cannot rename a sheet to the same name as another sheet"
What is wrong with my script?
Sub A0Rename()
For Each sh In Worksheets
If ActiveSheet.Cells(1, 1).Value = "Descriptives" Then sh.Name = "Means"
If ActiveSheet.Cells(1, 1).Value = "ANOVA" Then sh.Name = "ANOVA"
If ActiveSheet.Cells(1, 1).Value = "Test of Homogeneity of Variances"_
Then sh.Name = "HOV"
If ActiveSheet.Cells(1, 1).Value = "Multiple Comparisons" Then sh.Name_
= "Pairwise"
Next sh