Respondendo uma questão do forum:
Application.Volatile
Dim wf As WorksheetFunction
Set wf = WorksheetFunction
Dim Matrix() As Variant
On Error GoTo fim
ReDim Matrix(intval1.Count, 1)
For num = 1 To intval1.Count
If intval2(num) = cond Then
Matrix(num, 1) = intval1(num) * 1
Else
Matrix(num, 1) = 0
End If
Next
maximose = wf.Max(Matrix)
fim:
Debug.Print Err.Number & " " & Err.Description
End Function