ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   naming sheet tab (https://www.excelbanter.com/excel-worksheet-functions/126526-naming-sheet-tab.html)

artist4christ

naming sheet tab
 
I am trying to name the sheet tabs to correspond with the days of the month.
ie 1-31. Each book will be a month. How can I do this with out having to
remae all tabs individually?

Don Guillett

naming sheet tab
 

Easy enough to do but WHY? Are you planning on more than 65000 rows? If not,
why not ONE page and filter for the day desired.

--
Don Guillett
SalesAid Software

"artist4christ" wrote in message
...
I am trying to name the sheet tabs to correspond with the days of the
month.
ie 1-31. Each book will be a month. How can I do this with out having to
remae all tabs individually?




John Bundy

naming sheet tab
 
I think this is what you want, it will create 31 sheets, you can adjust as
needed

Sub main()
For j = 31 To 1 Step -1
i = 2
Sheets.Add
ActiveSheet.Move After:=Sheets(i)
ActiveSheet.Name = Cells(j, 1)
i = i + 1
Next
End Sub
--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"artist4christ" wrote:

I am trying to name the sheet tabs to correspond with the days of the month.
ie 1-31. Each book will be a month. How can I do this with out having to
remae all tabs individually?


artist4christ

naming sheet tab
 
and how/where exactly do i insert this? I am still very much a novice at the
finer points of excel

thanks

"John Bundy" wrote:

I think this is what you want, it will create 31 sheets, you can adjust as
needed

Sub main()
For j = 31 To 1 Step -1
i = 2
Sheets.Add
ActiveSheet.Move After:=Sheets(i)
ActiveSheet.Name = Cells(j, 1)
i = i + 1
Next
End Sub
--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"artist4christ" wrote:

I am trying to name the sheet tabs to correspond with the days of the month.
ie 1-31. Each book will be a month. How can I do this with out having to
remae all tabs individually?


John Bundy

naming sheet tab
 
on your first sheet starting in A1 and going down put 1-31, press Alt-F11, if
there is a window on the left of the screen that says Project VBA Project
then lists the sheets, double click sheet1, if its not there hit ctrl R then
do the same.
Then paste the code and push F5 and that should do it.
--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"artist4christ" wrote:

and how/where exactly do i insert this? I am still very much a novice at the
finer points of excel

thanks

"John Bundy" wrote:

I think this is what you want, it will create 31 sheets, you can adjust as
needed

Sub main()
For j = 31 To 1 Step -1
i = 2
Sheets.Add
ActiveSheet.Move After:=Sheets(i)
ActiveSheet.Name = Cells(j, 1)
i = i + 1
Next
End Sub
--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"artist4christ" wrote:

I am trying to name the sheet tabs to correspond with the days of the month.
ie 1-31. Each book will be a month. How can I do this with out having to
remae all tabs individually?


Gord Dibben

naming sheet tab
 
John

Just a heads' up................

Sheet modules should be reserved for event code, not general macros.

They are best placed into a General(or Standard) module.

Also, this macro requires no list of numbers on any sheet.

Sub Add_Sheets()
For i = 31 To 1 Step -1
Worksheets.Add.Name = i
Next
End Sub


Gord Dibben MS Excel MVP


On Wed, 17 Jan 2007 13:07:00 -0800, John Bundy (remove)
wrote:

on your first sheet starting in A1 and going down put 1-31, press Alt-F11, if
there is a window on the left of the screen that says Project VBA Project
then lists the sheets, double click sheet1, if its not there hit ctrl R then
do the same.
Then paste the code and push F5 and that should do it.




All times are GMT +1. The time now is 08:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com