Hi there,
I have an If statement below that works fine.
However, in the first part of the statement when the previous column is zero, it returns the #DIV/0! error.
How can I put an If statement before this one, thats says If rc[-1] equals 0 then return 0 in this column, else do the above If loop.
Hope that makes sense.
Thank you
I have an If statement below that works fine.
Code:
Do
If ActiveCell.Offset(0, -15) = ActiveCell.Offset(-1, -15) Or ActiveCell.Offset(0, -12) > 0 Then
ActiveCell.FormulaR1C1 = "=(rc[-3] / " & Gearratio & ") / rc[-1]"
Else
ActiveCell.FormulaR1C1 = "=(rc[-3] / " & Gearratio & ") * rc[-1]"
End If
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell(1, -1))
However, in the first part of the statement when the previous column is zero, it returns the #DIV/0! error.
Code:
ActiveCell.FormulaR1C1 = "=(rc[-3] / " & Gearratio & ") / rc[-1]
How can I put an If statement before this one, thats says If rc[-1] equals 0 then return 0 in this column, else do the above If loop.
Hope that makes sense.
Thank you