Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Ability to arrange tabs in a worksheet in chronological order | Excel Worksheet Functions | |||
Alphabetically order sheet tabs?? | Excel Discussion (Misc queries) | |||
How do I arrange my tabs in alphabetical order all at once? | Excel Discussion (Misc queries) | |||
Print order of worksheets | Excel Discussion (Misc queries) | |||
How do I arrange worksheet tabs In alpha order | Excel Worksheet Functions |