|What happens if either A1 and/or B1 equal zero?|
If that can never happen, then this shorter version might work for you:
By the way...
Mike's suggestion can be shortened since these 2 clauses:
can be combined as:
If B1 is not equal to zero, then it must greater than or less than 0, and since you want 0 in either case, you only need to check it once.
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.