Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Rename of sheets by macro
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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Rename of sheets by macro
Try this
Sub renamesheets() Sheets("sheet1").Name = "Main" 'etc For i = 5 To Sheets.Count 'Help, sheet5 as NN1, sheet6 to sheet55 as NN2 to NN50. Sheets("sheet" & i).Name = "NN" & i - 4 Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Harshad" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Rename of sheets by macro
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 |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Rename of sheets by macro
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro To Delete/Add & Rename/Arrange Sheets | Excel Discussion (Misc queries) | |||
Auto Rename Excel Sheets in Workbook | Excel Worksheet Functions | |||
TO RENAME & COLOR THE SHEETS | Excel Discussion (Misc queries) | |||
How do I rename multiple sheets at one time in Excel? | Excel Worksheet Functions | |||
Add Sheets and rename | Excel Discussion (Misc queries) |