Obtaining a certain date from columns

S

Suknit

Goddag, how do I make a macro that can get the latest date in a column.
Like I have many dates in that column and I want to get the newest date.

Thank in advance
 
J

joel

The latest data would be the Max value in the column. If you were usin
a formula it would be

=max(A:A)

The equivalent VBA code would be

Dim MaxDate As Date
MaxDate = WorksheetFunction.Max(Columns("A")
 
Top