date problem

M

mpreddy

Hi Frank, Thanks for ur reply.
But, you don't seem to have got my problem right.
What I want is, if I have in cells A1, A2, A3 Dates of 1-1-2004
4-4-2003, 6-6-2006 respectively, I need to get in Column C all th
possible dates between 4-4-2003 and 6-6-2006 i.e. 4-4-2003 in C1
4-5-2003 in C2, 4-6-2003 in C3 ...and so on upto 6-6-200
(chrnologically). I would appreciate if you could help through som
code.
MPRedd
 
D

Dave Peterson

This worked ok for me:

Option Explicit
Sub testme()

Dim myRng As Range
Dim myMax As Long
Dim myMin As Long
Dim wks As Worksheet
Dim DestCell As Range

Set wks = Worksheets("sheet1")
With wks
Set myRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp))

myMax = CLng(Application.Max(myRng))
myMin = CLng(Application.Min(myRng))

Set DestCell = .Range("C1")

With DestCell.Resize(myMax - myMin + 1, 1)
.Formula = "=" & myMin & "+row()-" & DestCell.Row
.Value = .Value
.NumberFormat = "mm/dd/yyyy"
End With
End With

End Sub
 
Top