date problem

  • Thread starter Thread starter mpreddy
  • Start date Start date
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
 
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
 

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

Similar Threads

Repeat data 1
Repeating cells 1
PLEASE HELP TO MATCH ALL SHEET AND THEN MERGE, 1
Help to create a macro 2
CONCATENATE by criteria and range 1
Total 1
Building Sum by Matching String 1
Vlookup with If condition 1

Back
Top