We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
in the second macro. The last value of date discovered in my oversimplistic macro might not be the latest date. It wouldn't be a problem if I could store each of dates in a range on the worksheet, but i can't.
Dt = WorksheetFunction.Max(myArray(0), myArray(1), myArray(2), myArray(3))
Sub FindMaxDate() Dim EIS As Range, NumSNs As Long, i As Long, Dt As Date, Dt2 As Date, Dt3 As Date NumSNs = WorksheetFunction.CountIf([LKP_SN], [V1]) Set EIS = [LKP_SN].Find(what:=[V1].Value) Dt = EIS.Offset(0, 1) 'On Error Resume Next For i = 2 To NumSNs Set EIS = [LKP_SN].Find(what:=[V1].Value, after:=EIS) Dt = EIS.Offset(0, 1) Next i [W1] = Dt End Sub
Sub demoArray1() Dim Lng As Long Dim Dt As Date Dim myArray(0 To 3) As Date myArray(0) = [D4] myArray(1) = [D5] myArray(2) = [D6] myArray(3) = [D7] Dt = WorksheetFunction.Max(myArray(0), myArray(1), myArray(2), myArray(3)) End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.