Sub test()
MsgBox LastValueOnRange([A:A])
End Sub
Function LastValueOnRange(rng As Range) 'par vba application
With Application: LastValueOnRange = .Max(.IfError(.Match("z", rng), 0), .IfError(.Match(9 ^ 99, rng), 0)): End With
End Function
'================================================================================================
Sub test2()
MsgBox LastValueOnRange2([A:A])
End Sub
Function LastValueOnRange2(rng) ' par evaluate
LastValueOnRange2 = Evaluate("MAX(iferror(match(""z""," & rng.Address(0, 0) & ",1),0), iferror(match(9^99," & rng.Address(0, 0) & ",1),0))")
End Function