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 looping a 'find and delete' code

Sub DeleteG17()
dim rng as Range
set rng = cells.find("G17", Lookat:=xlPart)
if not rng is nothing then
do
rng.EntireRow.Delete
set rng = cells.Find("G17", Lookat:=xlPart)
loop while not rng is nothing
end if
End Sub


--
Regards,
Tom Ogilvy


"matpj" wrote in
message ...

I have some VBA that will find and select a row where value "G17" exists
in column B.

I need to repeat this step until there are no "G17"s left in the
sheet.

can anyone tell me how??

thanks in advance..


--
matpj
------------------------------------------------------------------------
matpj's Profile:

http://www.excelforum.com/member.php...o&userid=21076
View this thread: http://www.excelforum.com/showthread...hreadid=483095