ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   looping a 'find and delete' code (https://www.excelbanter.com/excel-programming/345013-looping-find-delete-code.html)

matpj[_18_]

looping a 'find and delete' code
 

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


Tom Ogilvy

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





All times are GMT +1. The time now is 02:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com