I have a vba script that is causing a DIV/0 error. I have tried different approaches with no success. I am hoping to get some assistance. If I go on the spreadsheet and use the formula =IF(E6=0,0,E6/D6) this works on the spreadsheet so I tried to put this in a new formula I am now getting a run-time error 1004. application defined or object -defined error. For this example iTRow is 6.
Tom
Tom
Code:
'Original code
With goXL.ActiveSheet
'.Cells(iTRow, 6).Formula = "=if(ISBLANK(E" & (iTRow) & "),0,E" & (iTRow) & "/D" & (iTRow) & ")"
'2nd attempt
.Cells(iTRow, 6).Formula = "=if(E" & (iTRow) & "=0" & "),0,E" & (iTRow) & "/D" & (iTRow) & ")"
End with