Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looping down a Range to delete entire row sportsguy Excel Programming 3 July 1st 05 04:50 PM
Looping Find Next No Name Excel Programming 3 August 26th 04 01:57 PM
Code looping when it should not Todd Huttenstine Excel Programming 3 May 13th 04 09:37 PM
find & delete + fill to end code? direwolf Excel Programming 16 January 5th 04 03:25 AM
Looping Find pk Excel Programming 1 October 28th 03 09:26 PM


All times are GMT +1. The time now is 01:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"