I am trying to evaluate a formula with this code
Sub test()
Dim myRange As Range
Set myRange = Worksheets("Sheet1").Range("A1:B10")
'answer = Application.WorksheetFunction.Max(myRange)
answer = [SUMPRODUCT((LEN(myRange)>0)*1)]
MsgBox answer
End Sub
But I getting an error because I am passing the variable MyRange. which is an important part of this formula, because the ranges would change on different conditions
Please can anyone help
Sub test()
Dim myRange As Range
Set myRange = Worksheets("Sheet1").Range("A1:B10")
'answer = Application.WorksheetFunction.Max(myRange)
answer = [SUMPRODUCT((LEN(myRange)>0)*1)]
MsgBox answer
End Sub
But I getting an error because I am passing the variable MyRange. which is an important part of this formula, because the ranges would change on different conditions
Please can anyone help