Quantcast
Viewing latest article 1
Browse Latest Browse All 3

Answer by Vasily Ivoyzha for Find MAX in Column Range ignoring Error values using Evaluate Syntax

for those who have old ms excel version (<2010) that not supports AGGREGATE worksheetfunction:

Sub GetMax_oldstyle()
    Dim rng$, lr As Long
    With Sheet1 'Change accordingly
        lr = .Cells(.Rows.Count, "A").End(xlUp).Row
        rng = .Range("A1:B" & lr).Columns(2).Address(0, 0)
        If .Evaluate("MAX(IF(NOT(ISNA(" & rng & "))," & rng & "))") > 0 Then
            Debug.Print "Max is higher than 0"
        Else
            Debug.Print "Max is not higher than 0"
        End If
    End With
End Sub

test:

Image may be NSFW.
Clik here to view.
enter image description here


Viewing latest article 1
Browse Latest Browse All 3

Trending Articles