jarvisaurus
Board Regular
- Joined
- Nov 26, 2010
- Messages
- 52
I have a code to rename worksheets based on a cell value but I would like to rename subsequent sheets the next unique value.
First sheet equals APPLES, then BANANAS...so forth
APPLES
APPLES
APPLES
BANANA
BANANA
BANANA
I tried Offset to no avail...the current code goes on error renaming the subsequent worksheets "APPLES"
Thanks in advance.
First sheet equals APPLES, then BANANAS...so forth
APPLES
APPLES
APPLES
BANANA
BANANA
BANANA
PHP:
Sub RWS()
Application.ScreenUpdating = False
For i = 1 To Sheets.Count
If Worksheets(i).Range("A2").Value <> "" Then
Sheets(i).Name = Worksheets(i).Range("A2").Value
End If
Next
End Sub
I tried Offset to no avail...the current code goes on error renaming the subsequent worksheets "APPLES"
Thanks in advance.