For x = 1 to 50
If coord(x) = coord(x-1) then
'do stuff
'do stuff
end if
next x
works same way as kens but ken is right do while is little faster then "if next" so i would do it that way
remember you can also use
if not Coord(X) And Coord(X - 1) Then
too

(i think hehe) vba isnt my strong point normal vb6 is.