LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Deleting Rows based on multiple criteria

The piece of code I have right now is below
********************
Dim rng1 As Range
Dim what1 As String
what1 = "Elink Test Company 1"
Do
Set rng1 = ActiveSheet.UsedRange.Find(what1)
If rng1 Is Nothing Then
Exit Do
Else
Rows(rng1.Row).Delete
End If
Loop

Dim rng2 As Range
Dim what2 As String
what2 = "Elink Test Company 2"
Do
Set rng2 = ActiveSheet.UsedRange.Find(what2)
If rng2 Is Nothing Then
Exit Do
Else
Rows(rng2.Row).Delete
End If
Loop
********************


I have this piece of code already but I'd rather piece the two together
rather than separate it. I also have 6 other strings to delete as well.


Any help would be great!

 
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
Deleting blanks rows based on multiple criteria Pedros[_14_] Excel Programming 1 July 27th 06 05:44 AM
Deleting entire rows based on certain criteria Nan[_4_] Excel Programming 1 July 12th 04 05:04 PM
Deleting rows based on multiple criteria Sandip Shah Excel Programming 3 July 12th 04 01:57 PM
Deleting rows based on cell criteria jgranda Excel Programming 1 April 27th 04 06:41 PM
Deleting rows based on criteria John Walker[_2_] Excel Programming 2 December 12th 03 08:37 PM


All times are GMT +1. The time now is 01:28 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"