Quantcast
Viewing latest article 11
Browse Latest Browse All 445

Return first row number for max date

How do I write VBA to return the first row number found in column L for the max date in that column?

I'm trying this code and get

"Object variable or With block variable not set"

Sub FindMaxValRow()Dim Rng As RangeDim MaxCell As RangeDim MaxVal As LongSet Rng = Range("L1:L500")MaxVal = WorksheetFunction.Max(Rng)Set MaxCell = Rng.find(what:=MaxVal, LookIn:=xlValues)MsgBox "Maximum value found at row " & MaxCell.RowEnd Sub

Viewing latest article 11
Browse Latest Browse All 445

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>