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
|Multi-user Excel not reflecting who actually has the file opened||10||30|
|After updating data my Excel graphs are showing too many dates||8||32|
|Copy value from a certain cell||5||24|
|increment numbers by 10||11||30|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
15 Experts available now in Live!