ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Obtaining a certain date from columns (https://www.excelbanter.com/excel-programming/435954-obtaining-certain-date-columns.html)

Suknit

Obtaining a certain date from columns
 
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



joel[_200_]

Obtaining a certain date from columns
 

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

=max(A:A)

The equivalent VBA code would be

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


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=152305

Microsoft Office Help



All times are GMT +1. The time now is 12:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com