Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I got a worksheet that include the current Month, date , weekday and year. How do I create the macro to run that create the new worksheets accordingly to the days of the current months? Examples there's 30 days of the month of april. It will generated and create 30 worksheets? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Huom
hopefully, i've understood what you want - here's some code that will create a sheet for each day of the current month .. and number them from 1 to whatever the last day of the month is ... ---- Sub createsheets() If MsgBox("Are you very very sure you want to do this?", vbYesNo, "Create LOTS of Sheets") = vbYes Then For i = 1 To Day(DateSerial(Year(Date), Month(Date) + 1, 0)) Worksheets.Add Befo=Worksheets(Worksheets.Count) ActiveSheet.Name = i Next End If End Sub ---- -- Cheers JulieD check out www.hcts.net.au/tipsandtricks.htm ....well i'm working on it anyway "Houm" wrote in message ... I got a worksheet that include the current Month, date , weekday and year. How do I create the macro to run that create the new worksheets accordingly to the days of the current months? Examples there's 30 days of the month of april. It will generated and create 30 worksheets? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you very much. Yah, it does creat many sheets as
per month. But, I also would like the Month, Date,Weekday and year cells copy to all the new sheets that just been creat. The Date and weekday will increment by 1 to all the sheets. Examples: The default sheet has Month = April, Date= 05, weekday = Tuesday and year = 2005. The second sheet's date, weekday will be increse by one and next sheet so on... -----Original Message----- Hi Huom hopefully, i've understood what you want - here's some code that will create a sheet for each day of the current month .. and number them from 1 to whatever the last day of the month is ... ---- Sub createsheets() If MsgBox("Are you very very sure you want to do this?", vbYesNo, "Create LOTS of Sheets") = vbYes Then For i = 1 To Day(DateSerial(Year(Date), Month (Date) + 1, 0)) Worksheets.Add Befo=Worksheets (Worksheets.Count) ActiveSheet.Name = i Next End If End Sub ---- -- Cheers JulieD check out www.hcts.net.au/tipsandtricks.htm ....well i'm working on it anyway "Houm" wrote in message ... I got a worksheet that include the current Month, date , weekday and year. How do I create the macro to run that create the new worksheets accordingly to the days of the current months? Examples there's 30 days of the month of april. It will generated and create 30 worksheets? . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Huom
okay, assuming the sheet you've set up is called sheet1 and the date cell is C1 (base the Weekday cell on the date cell so it will change automatically) the following should do what you want. --- Sub createsheets() If MsgBox("Are you very very sure you want to do this?", vbYesNo, "Create LOTS of Sheets") = vbYes Then For i = 1 To Day(DateSerial(Year(Date), Month(Date) + 1, 0)) Sheets("Sheet1").Copy Befo=Worksheets(Worksheets.Count) ActiveSheet.Name = i Range("C1").Value = i Next End If End Sub --- -- Cheers JulieD check out www.hcts.net.au/tipsandtricks.htm ....well i'm working on it anyway "Huom" wrote in message ... Thank you very much. Yah, it does creat many sheets as per month. But, I also would like the Month, Date,Weekday and year cells copy to all the new sheets that just been creat. The Date and weekday will increment by 1 to all the sheets. Examples: The default sheet has Month = April, Date= 05, weekday = Tuesday and year = 2005. The second sheet's date, weekday will be increse by one and next sheet so on... -----Original Message----- Hi Huom hopefully, i've understood what you want - here's some code that will create a sheet for each day of the current month .. and number them from 1 to whatever the last day of the month is ... ---- Sub createsheets() If MsgBox("Are you very very sure you want to do this?", vbYesNo, "Create LOTS of Sheets") = vbYes Then For i = 1 To Day(DateSerial(Year(Date), Month (Date) + 1, 0)) Worksheets.Add Befo=Worksheets (Worksheets.Count) ActiveSheet.Name = i Next End If End Sub ---- -- Cheers JulieD check out www.hcts.net.au/tipsandtricks.htm ....well i'm working on it anyway "Houm" wrote in message ... I got a worksheet that include the current Month, date , weekday and year. How do I create the macro to run that create the new worksheets accordingly to the days of the current months? Examples there's 30 days of the month of april. It will generated and create 30 worksheets? . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do i create a macro to rename worksheets in excel? | Excel Discussion (Misc queries) | |||
CREATE MACRO TO COPY MULTIPLE WORKSHEETS | Excel Discussion (Misc queries) | |||
How to I create a macro in Excell to add multiple worksheets? | Excel Programming | |||
macro to create a chart from several worksheets | Excel Programming | |||
Macro to create worksheets base on name | Excel Programming |