G
Guest
I want my VB application to go through each sheet, check the value in a cell,
and re-name the worksheet according to the value in the cell.
I tried using a "For Each... Next" loop, but VB didn't like using this with
"Sheet" and "ActiveWorkbook" objects.
For Each Sheet In ActiveWorkbook
Select Case Range("A3").Value
Case "aaaa": ActiveSheet.Name = "Company A"
Case "bbbb": ActiveSheet.Name = "Company B"
End Select
Next Sheet
How can I make this work, or structure another loop to do the same action?
Any help is greatly appreciated.
Rgds,
Dan Winterton
and re-name the worksheet according to the value in the cell.
I tried using a "For Each... Next" loop, but VB didn't like using this with
"Sheet" and "ActiveWorkbook" objects.
For Each Sheet In ActiveWorkbook
Select Case Range("A3").Value
Case "aaaa": ActiveSheet.Name = "Company A"
Case "bbbb": ActiveSheet.Name = "Company B"
End Select
Next Sheet
How can I make this work, or structure another loop to do the same action?
Any help is greatly appreciated.
Rgds,
Dan Winterton