Divide Expression stops in Macro when Can't divide
Hello,
have following sample code:
Dim i as long
For i = 1 To ActiveSheet.UsedRange.Rows.Count
If Cells(i, "A") = "SEM Total" Then
Cells(i, "D").Value = Cells(i, "C") / Cells(i, "B")
Cells(i, "G").Value = Cells(i, "F") / Cells(i, "E")
Works fine but if it cannot divide, the macro stops.
Example,
I could have in Col C 0 and Cold B 0, so this can't be
divided. 0/0 OR 1/0. Is there a way round this?
Please advise any info. would appreciate it alot.
Thanks
Juan
|