Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Minimum and maximum date lookup | Excel Worksheet Functions | |||
Finding a maximum/minimum date in 2006 | Excel Discussion (Misc queries) | |||
How to find the maximum from a list of variables? | Excel Programming | |||
How do I find the cell reference that contains the minimum or maximum | Excel Worksheet Functions | |||
How do I find the maximum time value from a list | Excel Worksheet Functions |