finding cell info to rename sheet(s)?

  • Thread starter Thread starter lance-news
  • Start date Start date
L

lance-news

I am trying to find a way to rename a sheet. Cell(1 ,1) is blank
and Cell(1,2) always includes "Cluster Number of Case" but will have
some other info as well i.e. "VAR001 Cluster Number of Case" so a
search would be something similar to (* Cluster Number of Case).
The line:

If sh.Cells(1, 1).Value = " " Then sh.Name = "MEANS"

does not work and I would actually prefer to search cells(2,1) for
"Cluster Number of Case".

Any suggestions?

Lance



For Each sh In Worksheets
If sh.Cells(1, 1).Value = "ANOVA" Then sh.Name = "ANOVA"
If sh.Cells(1, 1).Value = "Descriptives" Then sh.Name = "ANOVA Means"
If sh.Cells(1, 1).Value = "Test of Homogeneity of Variances" Then
sh.Name = "HOV"
If sh.Cells(1, 1).Value = "Multiple Comparisons" Then sh.Name = "Pairwise"
If sh.Cells(1, 1).Value = " " Then sh.Name = "MEANS"
Next sh
 
If sh.Cells(1, 1).Value = " " Then sh.Name = "MEANS"

The above looks for a space in A1. If it's an empty cell you're checking
for do this:

If sh.Cells(1, 1).Value = "" Then sh.Name = "MEANS"
 
Back
Top