Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Everyone,
Is it possible to have a macro changing sheet numbers automaticaly. My workbook contains over 300 sheets starting from number 1. Thank you Albert |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You just want them numbered 1 to 300?
Enter the numbers 1 to 300 in column A of first sheet. Run this macro. Sub NameWS() 'name sheets with list in A1:A300 on first sheet On Error Resume Next For i = 1 To Worksheets.Count Sheets(i).Name = Sheets(1).Cells(i, 1).Value Next i End Sub Gord Dibben MS Excel MVP On Sat, 12 Jan 2008 22:11:00 -0800, albertmb wrote: Hi Everyone, Is it possible to have a macro changing sheet numbers automaticaly. My workbook contains over 300 sheets starting from number 1. Thank you Albert |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Do you really need to put the numbers in Column A? This would work, right?
Sub NameWS() Dim i As Long On Error Resume Next For i = 1 To Worksheets.Count Sheets(i).Name = i Next i End Sub Rick "Gord Dibben" <gorddibbATshawDOTca wrote in message ... You just want them numbered 1 to 300? Enter the numbers 1 to 300 in column A of first sheet. Run this macro. Sub NameWS() 'name sheets with list in A1:A300 on first sheet On Error Resume Next For i = 1 To Worksheets.Count Sheets(i).Name = Sheets(1).Cells(i, 1).Value Next i End Sub Gord Dibben MS Excel MVP On Sat, 12 Jan 2008 22:11:00 -0800, albertmb wrote: Hi Everyone, Is it possible to have a macro changing sheet numbers automaticaly. My workbook contains over 300 sheets starting from number 1. Thank you Albert |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank You all, you are marvelous people.
Rick, it worked perfectly. "Rick Rothstein (MVP - VB)" wrote: Do you really need to put the numbers in Column A? This would work, right? Sub NameWS() Dim i As Long On Error Resume Next For i = 1 To Worksheets.Count Sheets(i).Name = i Next i End Sub Rick "Gord Dibben" <gorddibbATshawDOTca wrote in message ... You just want them numbered 1 to 300? Enter the numbers 1 to 300 in column A of first sheet. Run this macro. Sub NameWS() 'name sheets with list in A1:A300 on first sheet On Error Resume Next For i = 1 To Worksheets.Count Sheets(i).Name = Sheets(1).Cells(i, 1).Value Next i End Sub Gord Dibben MS Excel MVP On Sat, 12 Jan 2008 22:11:00 -0800, albertmb wrote: Hi Everyone, Is it possible to have a macro changing sheet numbers automaticaly. My workbook contains over 300 sheets starting from number 1. Thank you Albert |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
True, you don't need the numbers in Column A.
Your code works fine. I posted standard code that will use whatever is in column A, be it numbers or a list of unique names of all my grand-children. But I wouldn't need A1:A300<g. Gord On Sun, 13 Jan 2008 01:51:18 -0500, "Rick Rothstein \(MVP - VB\)" wrote: Do you really need to put the numbers in Column A? This would work, right? Sub NameWS() Dim i As Long On Error Resume Next For i = 1 To Worksheets.Count Sheets(i).Name = i Next i End Sub Rick "Gord Dibben" <gorddibbATshawDOTca wrote in message .. . You just want them numbered 1 to 300? Enter the numbers 1 to 300 in column A of first sheet. Run this macro. Sub NameWS() 'name sheets with list in A1:A300 on first sheet On Error Resume Next For i = 1 To Worksheets.Count Sheets(i).Name = Sheets(1).Cells(i, 1).Value Next i End Sub Gord Dibben MS Excel MVP On Sat, 12 Jan 2008 22:11:00 -0800, albertmb wrote: Hi Everyone, Is it possible to have a macro changing sheet numbers automaticaly. My workbook contains over 300 sheets starting from number 1. Thank you Albert |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I posted standard code that will use whatever is in column A, be it
numbers or a list of unique names of all my grand-children. But I wouldn't need A1:A300<g. LOL Rick |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Rick I kept a copy of your macro to, but I still did not have the time to try
it out, I will let you know. Thank you ever so much Albert "Rick Rothstein (MVP - VB)" wrote: I posted standard code that will use whatever is in column A, be it numbers or a list of unique names of all my grand-children. But I wouldn't need A1:A300<g. LOL Rick |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Unable to add numbers from another sheet | Excel Discussion (Misc queries) | |||
Filling Sheet numbers in a column | Excel Worksheet Functions | |||
In spread sheet the numbers entered as whole numbers become decim | Excel Worksheet Functions | |||
Numbers I enter on one sheet transfer onto others sometimes. Why? | Excel Discussion (Misc queries) | |||
Disappearance of Sheet Numbers | New Users to Excel |