Date question over 3 years

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

Hi I have column 1 on my sheet I would like to use this
to display the date for each day of the month but I would
like to have a row in between each of the rows with a
blank. I have got 3 years so 36 tabs to do!!

Can anyone tell me how to do this?

Many Thanks
Rob
 
Hi,

You don't really need programming for this. Enter 10/1/2004 in cell a1.
Enter =a1+1 in cell a3. Copy range a2-a3 over a4-a61. That takes care of 1
month. Copy your sheet 35 times. In each new sheet, replace the value in a1
with whatever is appropriate (9/1, 8/1, etc.) Trim the bottom for months that
have fewer than 31 days.

Less elegant than programming, but maybe more expedient.
 
how can I get the space between all of the days without
having to go through each?
 
Sorry my browser sent or I tapped the wrong key but
thanks for the reply mister
 
If you leave a2 blank, and then replicate the a2:a3 range, then it will
follow that a4 is blank, a6 is blank, etc., right?
 
Yes.. Thanks again
-----Original Message-----
If you leave a2 blank, and then replicate the a2:a3 range, then it will
follow that a4 is blank, a6 is blank, etc., right?


.
 
Open a new workbook. Paste in this macro and run it:

Sub Setup3Years()
Dim dtStart As Date
Dim dtEnd As Date
Dim dt As Date
Dim dtOld As Date
Dim i As Long
i = -1
dtStart = #1/1/2004#
dtEnd = #12/31/2006#
dtOld = dtStart - 35
For dt = dtStart To dtEnd Step 1
i = i + 2
If Month(dt) <> Month(dtOld) Then
Columns(1).Autofit
Worksheets.Add _
After:=Worksheets(Worksheets.Count)
ActiveSheet.Name = Format(dt, "MMM_YY")
i = 1
End If
Cells(i, 1).Value = dt
dtOld = dt
Next
Columns(1).autofit
End Sub
 

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

Back
Top