View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Testing for contiguous cells

if intersect(Range("A1").End(xldown).End(xltoRight),R ange("A1:J10")) is
nothing then
if intersect(Range("A1").End(xltoRight).End(xldown),R ange("A1:J10)) is
nothing then
msgbox "Not orthogonally contiguous"
end if
End if

of
if isemtpy(Range("A1").End(xldown).offset(0,1)) then
if isempty(Range("A1").End(xltoRight).Offset(1,0)) Then
msgbox "Not orthogonally contiguous"
end if
End if

--
Regards,
Tom Ogilvy

"jamieuk" wrote in message
om...
For a game, I need to determine whether non-blank cells in range
A1:J10 are orthogonally contiguous. If I had values in cells A1, A2,
A3, B3 and C3 then the result would be true. However, remove the value
from cell A3 and the result is now false. Any ideas how to do this
test?