Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Is there a way to name tabs so that they will ascend in order?

I am trying to label excel tabs so that they will go up automatically in
order (ie. Jan 1, Jan. 2, Jan. 3, etc).
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Is there a way to name tabs so that they will ascend in order?

Yes. It is very easy to sort them:

http://www.cpearson.com/excel/sortws.htm

--
Gary's Student


"madchef" wrote:

I am trying to label excel tabs so that they will go up automatically in
order (ie. Jan 1, Jan. 2, Jan. 3, etc).

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Is there a way to name tabs so that they will ascend in order?

myDate = DateSerial(2006,1,1)
For i = 1 To Activeworkbook.worksheets.count
Worksheets(i).Name = Format(myDate,"mmm d")
myDate = myDate + 1
Next i

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"madchef" wrote in message
...
I am trying to label excel tabs so that they will go up automatically in
order (ie. Jan 1, Jan. 2, Jan. 3, etc).



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Is there a way to name tabs so that they will ascend in order?

Just a suggestion before you get too far into your workbook design.

You may want to use this variation of Bob's routine:

myDate = DateSerial(2006,1,1)
For i = 1 To Activeworkbook.worksheets.count
Worksheets(i).Name = Format(myDate,"yyyy_mm_dd")
myDate = myDate + 1
Next i

It'll make sorting the sheets much easier if you have to do this later.

madchef wrote:

I am trying to label excel tabs so that they will go up automatically in
order (ie. Jan 1, Jan. 2, Jan. 3, etc).


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 117
Default Is there a way to name tabs so that they will ascend in order?

I like this topic especially when dates are pre-determined....I like to do
this workbook design also yet considering only 6 days a week....hope we may
have this good for office dummie like me..........


"madchef" wrote:

I am trying to label excel tabs so that they will go up automatically in
order (ie. Jan 1, Jan. 2, Jan. 3, etc).



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Is there a way to name tabs so that they will ascend in order?

Change the starting date, ending date and format--and the day to skip:

Option Explicit
Sub testme()

Dim iDate As Long

For iDate = DateSerial(2006, 1, 1) To DateSerial(2006, 5, 12)
If Weekday(iDate) = vbSunday Then
'do nothing
Else
Worksheets.Add after:=Worksheets(Worksheets.Count)
ActiveSheet.Name = Format(iDate, "yyyy_mm_dd dddd")
End If
Next iDate
End Sub


romelsb wrote:

I like this topic especially when dates are pre-determined....I like to do
this workbook design also yet considering only 6 days a week....hope we may
have this good for office dummie like me..........

"madchef" wrote:

I am trying to label excel tabs so that they will go up automatically in
order (ie. Jan 1, Jan. 2, Jan. 3, etc).


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 117
Default Is there a way to name tabs so that they will ascend in order?

Hello Dave...never been in VBE...hope u dont mind to teach me how and where
to paste everybody's good idea...thanks
--
"Bright minds are blessed to those who share them.."-rsb.


"Dave Peterson" wrote:

Change the starting date, ending date and format--and the day to skip:

Option Explicit
Sub testme()

Dim iDate As Long

For iDate = DateSerial(2006, 1, 1) To DateSerial(2006, 5, 12)
If Weekday(iDate) = vbSunday Then
'do nothing
Else
Worksheets.Add after:=Worksheets(Worksheets.Count)
ActiveSheet.Name = Format(iDate, "yyyy_mm_dd dddd")
End If
Next iDate
End Sub


romelsb wrote:

I like this topic especially when dates are pre-determined....I like to do
this workbook design also yet considering only 6 days a week....hope we may
have this good for office dummie like me..........

"madchef" wrote:

I am trying to label excel tabs so that they will go up automatically in
order (ie. Jan 1, Jan. 2, Jan. 3, etc).


--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Is there a way to name tabs so that they will ascend in order?

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

=======

Short course:
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there. (But change the name from TestMe to something
significant.)

Now go back to excel to test it out.

Tools|Macro|macros|select that macro and click Run

Save your workbook before you run the macro--then if you have trouble, you can
close without saving and bring things back the way they were.

Note: DateSerial(2006, 1, 1) is dateserial(year#, month#, day#)



romelsb wrote:

Hello Dave...never been in VBE...hope u dont mind to teach me how and where
to paste everybody's good idea...thanks
--
"Bright minds are blessed to those who share them.."-rsb.

"Dave Peterson" wrote:

Change the starting date, ending date and format--and the day to skip:

Option Explicit
Sub testme()

Dim iDate As Long

For iDate = DateSerial(2006, 1, 1) To DateSerial(2006, 5, 12)
If Weekday(iDate) = vbSunday Then
'do nothing
Else
Worksheets.Add after:=Worksheets(Worksheets.Count)
ActiveSheet.Name = Format(iDate, "yyyy_mm_dd dddd")
End If
Next iDate
End Sub


romelsb wrote:

I like this topic especially when dates are pre-determined....I like to do
this workbook design also yet considering only 6 days a week....hope we may
have this good for office dummie like me..........

"madchef" wrote:

I am trying to label excel tabs so that they will go up automatically in
order (ie. Jan 1, Jan. 2, Jan. 3, etc).


--

Dave Peterson


--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 117
Default Is there a way to name tabs so that they will ascend in order?

thanks Dave..
--
"Bright minds are blessed to those who share them.."-rsb.


"Dave Peterson" wrote:

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

=======

Short course:
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there. (But change the name from TestMe to something
significant.)

Now go back to excel to test it out.

Tools|Macro|macros|select that macro and click Run

Save your workbook before you run the macro--then if you have trouble, you can
close without saving and bring things back the way they were.

Note: DateSerial(2006, 1, 1) is dateserial(year#, month#, day#)



romelsb wrote:

Hello Dave...never been in VBE...hope u dont mind to teach me how and where
to paste everybody's good idea...thanks
--
"Bright minds are blessed to those who share them.."-rsb.

"Dave Peterson" wrote:

Change the starting date, ending date and format--and the day to skip:

Option Explicit
Sub testme()

Dim iDate As Long

For iDate = DateSerial(2006, 1, 1) To DateSerial(2006, 5, 12)
If Weekday(iDate) = vbSunday Then
'do nothing
Else
Worksheets.Add after:=Worksheets(Worksheets.Count)
ActiveSheet.Name = Format(iDate, "yyyy_mm_dd dddd")
End If
Next iDate
End Sub


romelsb wrote:

I like this topic especially when dates are pre-determined....I like to do
this workbook design also yet considering only 6 days a week....hope we may
have this good for office dummie like me..........

"madchef" wrote:

I am trying to label excel tabs so that they will go up automatically in
order (ie. Jan 1, Jan. 2, Jan. 3, etc).

--

Dave Peterson


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ability to arrange tabs in a worksheet in chronological order Amanda Excel Worksheet Functions 2 October 4th 06 04:32 PM
Alphabetically order sheet tabs?? Bro23 Excel Discussion (Misc queries) 11 June 21st 06 08:22 PM
How do I arrange my tabs in alphabetical order all at once? Zara Excel Discussion (Misc queries) 3 May 4th 06 01:18 AM
Print order of worksheets Stray Doug Excel Discussion (Misc queries) 3 September 21st 05 12:37 AM
How do I arrange worksheet tabs In alpha order Worksheet order Excel Worksheet Functions 2 June 24th 05 07:00 PM


All times are GMT +1. The time now is 01:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"