I have a set of dates pulled from a PivotTable (which can either be accessed straight from the PT or I can copy it into a new sheet - I'm not fussed either way) and I need both the earliest and latest date e.g.
Scheduled date
01/01/17
05/08/17
08/11/16
03/12/16
...
So all I want is for VBA to tell me that the earliest date is 08/11/16 and the latest is 05/08/17 (This is part of a macro that cycles through different versions of different assessments, so a manual fix won't suffice and the model is so large that an array formula in the sheet is going to make it ridiculously slow).
So far I have tried the following for the earliest date:
Dim AllDates As Variant
Dim NumberDates As Integer
Dim Earliest As Date, Latest As Date
Set AllDates = ThisWorkbook.Sheets("Pivot Table 5 - To Use").Range("A4:A203")
'Attempt 1
Earliest = WorksheetFunction.Min(AllDates)
'Attempt 2
Earliest = Format(Application.Min(AllDates), "dd/mm/yyyy")
'Attempt 3
Earliest = Format(WorksheetFunction.Min(AllDates), "dd/mm/yyyy")
'Attempt 4
Debug.Print CDate(Application.Max(AllDates))
Every attempt results in "00:00:00" so I'm assuming I am actually working with Date values (I doubled checked and ensured that the worksheets were formatted to the correct date format) but beyond that I am COMPLETELY stumped.