days of the current month

  • Thread starter Thread starter David Gladstone
  • Start date Start date
D

David Gladstone

Is there a simple way to fill the days of the current month, e.g.
November 1 to 30 and February 1 to 28(or 29)?
I want to create a template to record temperature, rainfall etc for
each day of the month. Ideally this would create a new worksheet,
even better if it named that sheet November 2011 etc.
Thanks in advance
 
Is there a simple way to fill the days of the current month, e.g.
November 1 to 30 and February 1 to 28(or 29)?
I want to create a template to record temperature, rainfall etc for
each day of the month.  Ideally this would create a new worksheet,
even better if it named that sheet November 2011 etc.
Thanks in advance
Why not just use ONE sheet with the whole year added a month at a time
with this macro. Then use DATA>Autofilter>filter by the month

Sub AddMonthOfDaysSAS()Dim lr As LongDim numdays As DoubleIf
Len(Application.Trim(Range("a2"))) < 1 Then   Range("a2") =
DateSerial(Year(Now), 1, 1)   Range("a2").AutoFill
Destination:=Range("a2:a32")Else   lr = Cells(Rows.Count,
1).End(xlUp).Row   numdays = Day(DateSerial(Year(Cells(lr, 1)),
Month(Cells(lr, 1)) + 2, 0))   Cells(lr + 1, 1) = Cells(lr, 1) + 1 
 Cells(lr + 1, 1).AutoFill Destination:=Cells(lr + 1,
1).Resize(numdays)End IfEnd Sub
 
Enter a date in a cell... November 01, 2011
Format the cell, so the date appears as you want.
Grab the fill handle (lower right corner of the cell) with the mouse and fill down.
--
Jim Cone
Portland, Oregon USA .
http://www.contextures.com/excel-sort-addin.html .
(editorial review of Special Sort excel add-in (30 ways to sort)




"David Gladstone"
<[email protected]>
wrote in message
news:ca42d386-6888-4530-8a7d-14184ef90f4a@h34g2000yqd.googlegroups.com...
 
Back
Top