Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default finding cell info to rename sheet(s)?

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default finding cell info to rename sheet(s)?

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"


--
Jim Rech
Excel MVP


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i rename a sheet if the rename tab is inactive? Nelson Excel Worksheet Functions 1 March 3rd 10 10:28 AM
Rename Sheet using Cell Reference RDana Excel Worksheet Functions 4 July 2nd 07 07:54 PM
Finding Info from sheet 1 and removing only those rows from sheet Johnny B[_2_] Excel Discussion (Misc queries) 1 March 28th 07 02:29 PM
How do I automatically rename a sheet with the contents of a cell. michaelspearin Excel Discussion (Misc queries) 3 December 3rd 04 09:27 PM
Macro to rename all worksheets with cell value in each sheet Max Excel Programming 1 July 11th 03 10:58 AM


All times are GMT +1. The time now is 11:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"