That must be it. I went back and changed temp_v to a variant and "cast" temp_v this way

temp_v = CInt(i)

if i <> CInt(temp_v) then ....

The above appears to "make" the if compare integers. Thanks all. This thread is closed. Thanks to all.