Try these changes
With Worksheets("Settings_North")
dt = .Cells(2, 2).Value
yr = Year(dt)
nt = .Cells(2, 6).Value
' == new code ....
dt = "01/" & Application.InputBox(prompt:="Input Date as mm/yy", Type:=2)
If Not IsDate(dt) Then
MsgBox "Invalid date"
Exit Sub
End If
yr = Year(dt)
StartDate = DateSerial(yr, Month(dt), 1)
EndDate = DateSerial(yr, Month(dt) + 1, 0)
'<==== End new code
Set rng = .Range(.Cells(2, 1), .Cells(2, 1).End(xlDown))
End With
..
..
..
For i = Month(dt) To Month(dt)
HTH
"Jim Cone" wrote:
MS has already done it for you...
http://support.microsoft.com/kb/213795/en-us
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
"James Cooper"
wrote in message
Hello,
Below you will find a yearly calendar vba code that creates a worksheet for
each month at one time. I would like to change the calendar to monthly using
a input box choosing the month and year. How can I modify the code to use a
input box to select the month and year so that is will create one worksheet
for a selected month and year?
-snip-