View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Date question over 3 years

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

--
Regards,
Tom Ogilvy


"Rob" wrote in message
...
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