I have a macro that makes several calculations, but I can't figure out how to handle a divide by zero error ("overflow" for the macro). I've tried using the IfError function and get the same result. Ideally, I'd like it to place a "0" in the cell if there are no results for the denominator. Can someone help? Here's the calculation line. . .
Code:
.Range("I39").Value = WorksheetFunction.SumIf(Worksheets("All_Properties").Range("H:H"), "Rejected", _
Worksheets("All_Properties").Range("K:K")) / WorksheetFunction.SumIf(Worksheets("All_Properties").Range("H:H"), _
"Rejected", Worksheets("All_Properties").Range("L:L"))