Thread: Calendar help
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
kimberlynn kimberlynn is offline
external usenet poster
 
Posts: 3
Default Calendar help

macro?

"Tom Ogilvy" wrote:

select the cell with the date range as you have shown and run this macro:

Sub AddDates()
Dim s As String, s1 As String
Dim s2 As String, i As Long
Dim dt As Date, iloc As Long
s = ActiveCell.Value
iloc = InStr(1, s, "-", vbTextCompare)
If iloc = 0 Then Exit Sub
s1 = Trim(Left(s, iloc - 1))
s2 = Trim(Right(s, Len(s) - iloc))
i = 1
Debug.Print s1, s2
For dt = CDate(s1) To CDate(s2)
ActiveCell.Offset(i, 0) = dt
i = i + 1
Next
End Sub

--
Regards,
Tom Ogilvy


"kimberlynn" wrote:

last year i made a calendar and i manual inputted all the days. i have been
trying to figure out how have the auto fill in.
what i did was put the weekly dates in like this... in one block

02/01/2006 - 02/04/2006

then below that i manual put in the dates like this...

02/01/2006
02/02/2006

what i was wondering is there a way that when i insert the weekly dates that
block automaticaly fills in the date blocks below?