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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -