View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
d61helix d61helix is offline
external usenet poster
 
Posts: 1
Default stop a macro if it does not contain


nv test it out but shld be correct


Code:
--------------------
sub macro()

For each rngCell in activesheet.range(A2:A30000).cells

if rngCell.value="wildman" then
blnWildman=true
blnNotEmpty=true
exit for
elseif rngCell<empty then
blnNotEmpty=true
exit for
end if

next rngCell

if blnWildman<true and blnNotEmpty<true then
Exit sub
end if

<macro code

End Sub
--------------------


--
d61helix
------------------------------------------------------------------------
d61helix's Profile: http://www.excelforum.com/member.php...o&userid=20090
View this thread: http://www.excelforum.com/showthread...hreadid=375134