PDA

View Full Version : Solved: Rename tab



ndendrinos
04-06-2007, 08:28 AM
Hello,
I'm trying to rename the active sheet after the value in A1 of the previous sheet.
example: if first sheet has a value in A1 of 10 then the next sheet will be named 11

Thank you

Bob Phillips
04-06-2007, 08:34 AM
If it is always numeric



With Activesheet
If .Index > 1 Then
.Name = Worksheets(.Index - 1).Range("A1").Value + 1
End If
End With

ndendrinos
04-06-2007, 08:45 AM
Thank you works great.
Is it possible to rename the new sheet after the previous sheet +1 ?
Example first sheet is 10 next sheet will be 11
If not I will have cell A1 of new sheet named after the sheet's tab

lucas
04-06-2007, 08:48 AM
With ActiveSheet
If .Index > 1 Then
.Name = Worksheets(.Index - 1).Name + 1
End If
End With
I think they have to be numeric though...

ndendrinos
04-06-2007, 08:58 AM
Thank you both
I've named my template 0 (zero) and the two solutions work
Have a happy Easter