Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub createsheets()
If MsgBox( "Are you very very sure you want to do this?", _ vbYesNo, "Create LOTS of Sheets") = vbYes Then szMonth = Inputbox("Supply month number (1-12)") szDays = Day(DateSerial(Year(Date),szMonth, 0)) For i = 1 To szDays Worksheets("Sheet1").Copy Befo= _ Worksheet(Worksheets.Count) ActiveSheet.Name = i Range("F3").Value = DateSerial(Year(Date), szMonth, i) Next i End If End Sub -- HTH RP (remove nothere from the email address if mailing direct) "hume" wrote in message ... Hi, The following code are run and creat many sheets depand on the how many days of the current month. But instead of just ONLY creat the current month, I would like to have an option with the message box to ask me which month that I like to creat the form. Then it will creat the sheets according to the input date I provide. How do I do that? 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=Worksheet (Worksheets.Count) ActiveSheet.Name = i Range("F3").Value = DateSerial(Year(Date), _ Month(Date) + 0, i) Next End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How input today's date and keep that date | Excel Worksheet Functions | |||
input a date or update it based on date in another cell | New Users to Excel | |||
date input | Excel Discussion (Misc queries) | |||
input date as date in formula | Excel Programming | |||
input date as date in formula | Excel Programming |