days of the current month

  • Thread starter David Gladstone
  • 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
 
D

Don Guillett

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
 
J

Jim Cone

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top