Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro to create the new worksheets.


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Macro to create the new worksheets.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to create the new worksheets.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Macro to create the new worksheets.

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
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
how do i create a macro to rename worksheets in excel? Waki Excel Discussion (Misc queries) 6 January 28th 10 04:06 PM
CREATE MACRO TO COPY MULTIPLE WORKSHEETS Bewilderd jim Excel Discussion (Misc queries) 5 March 3rd 05 10:00 PM
How to I create a macro in Excell to add multiple worksheets? TBarnes Excel Programming 2 October 21st 04 04:46 PM
macro to create a chart from several worksheets dpkk2 Excel Programming 2 July 28th 04 02:12 AM
Macro to create worksheets base on name unplugs[_47_] Excel Programming 1 July 12th 04 05:29 AM


All times are GMT +1. The time now is 09:40 AM.

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

About Us

"It's about Microsoft Excel"