View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
miek miek is offline
external usenet poster
 
Posts: 39
Default Get max & min dates from column

Thanks This worked fine.
I used: d1 = Format(WorksheetFunction.Max(Range("d:d")), "mm/dd/yyyy")


"Gary''s Student" wrote:

With dates in column D:

Sub dated()
x = Application.WorksheetFunction.Max(Range("D:D"))
MsgBox (Format(x, "mm/dd/yyyy"))
End Sub

and similar for the min. This is because Dates are really just numbers with
a fancy format!
--
Gary''s Student - gsnu200781


"miek" wrote:

Column "D" has random date values in cells
I need to retrieve the min and max dates from this column and store values
in a varible.
I have tried the following:
Dim d1 As Date
Application.Min (Application.Index(d1, 0, 4)) '4=column D
This just returns a time stamp