LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Find the minimum and maximum date in a list

Sub findDates()
Dim rng As Range
Dim minMyDate As Date
Dim maxMyDate As Date

Set rng = Range(Cells(1, 1), Cells(Rows.Count, 1).End(xlUp))
maxMyDate = Evaluate("=MAX(" & rng.Address & ")")
minMyDate = Evaluate("=MIN(" & rng.Address & ")")

MsgBox " MIN DATE IS " & minMyDate & vbCrLf & "MAX DATE IS " &
maxMyDate
End Sub

"jeremiah" wrote:

Yes, I had considered but was looking for a macro solution. Was trying to
avoid having any formulas on the worksheet itself. The totals are being
pulled from a filtered list so I either needed to create a report template or
let a macro do it's trick and add the header to the filtered list. This will
work, just looking for alternative solutions.

"Barb Reinhardt" wrote:

Have you considered using MIN and MAX to get your dates?

Barb Reinhardt

"jeremiah" wrote:

My datasheet includes 4K plus records that each have a date associated with
them - the dates can be duplicated throughout. I am trying to create a
report to total all of those records and in the heading I need to have the
date range. So I need to search the date column and find the earliest date
and the latest date and copy just those dates to my header on my totals
worksheet. How can I find and copy those dates to a new worksheet? Have
searched and can't seem to find just the right hint.



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Minimum and maximum date lookup Michael Peace Excel Worksheet Functions 3 October 26th 07 06:17 PM
Finding a maximum/minimum date in 2006 megacata Excel Discussion (Misc queries) 5 January 4th 07 06:43 PM
How to find the maximum from a list of variables? Chip Pearson Excel Programming 0 December 1st 06 06:25 PM
How do I find the cell reference that contains the minimum or maximum fadsnet Excel Worksheet Functions 4 September 4th 06 04:30 PM
How do I find the maximum time value from a list Lee Excel Worksheet Functions 3 June 20th 06 10:48 AM


All times are GMT +1. The time now is 02:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"