excel - VBA script when dividing by zero -
i trying formula in vba, coming across errors because of 0 in denominator. if have 0 in denominator, i'd active cell set zero. whatever doing incorrect, , not programmer. have no idea i'm doing. appreciated. here
range("h" & row).activate if range("f" & row) = 0 activecell.formula = 0 activecell.formula = range("g" & row) / range("f" & row)
try using else
something like
range("h" & row).activate if range("f" & row) = 0 activecell.formula = 0 else activecell.formula = range("g" & row) / range("f" & row) end if
Comments
Post a Comment