View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Harshad[_2_] Harshad[_2_] is offline
external usenet poster
 
Posts: 44
Default Rename of sheets by macro

Dear Mike & Don,

Don,
Your macro works very fine. Thank you.

Mike,
It's very nice that i can utilize both macro in a single code. It also works
very fine, but again the problem of sheet order is there.
I want it as order : Main, Content, Micro, Help, NN1, NN2.......NN51.

But it shows the order: Main, Help, NN1, NN2,...,NN51, Content, Micro.

Kindly revert back.


"Mike H" wrote:

Why not do it all in one go when you add them

Sub Sheet_addition()
Dim i As Long
On Error GoTo endit
Application.ScreenUpdating = False
For i = 1 To 52
Sheets.Add after:=Sheets(i)
If i 1 Then ActiveSheet.Name = "NN" & i - 1
Next i
endit:
Sheets("Sheet1").Name = "Main"
Sheets("Sheet2").Name = "Content"
Sheets("Sheet3").Name = "Micro"
Sheets("Sheet4").Name = "Help"
Application.ScreenUpdating = True
End Sub

Mike

"Harshad" wrote:

i have Sheet1 to Sheet 55 in my workbook.

I want Sheet1 rename as Main, sheet2 as Content, sheet3 as Micro, sheet4 as
Help, sheet5 as NN1, sheet6 to sheet55 as NN2 to NN50.

Sugest macro.

Thanks