Divide by Zero

S

Steve

How Can I get rid of/avoid Divide by 0 Errors?

Somestimes it's unavoidable.

Thanks
Steve
 
M

Mike Painter

Steve said:
How Can I get rid of/avoid Divide by 0 Errors?

Somestimes it's unavoidable.

If Bottom = 0 or IsNull(Bottom) then

msgbox "you can't divide by zero"
else
ans = top/bottom.

end if.

This is a crude solution

While I can think of a few cases where it might cause a problem, usually it
can be avoided with proper design.
 
Top