I am trying to calculate % in Excel Sheet via VBA code as follows:
.ActiveCell.FormulaR1C1 = "=IF((ISBLANK(RC[-2])=FALSE),IF((ISERROR(RC[-2]/RC[-1]),0,RC[-2]/RC[-1]),"""")"
But it gives me an error.
If the RC[-2] column is blank, the result of the % column should be blank, if not, I need to check if the denominator is 0 in order to avoid division by zero error (#DIV/0! is populated if the denominator is zero)
Can somebody please point out where is the error.