PC Review


Reply
Thread Tools Rate Thread

Deleting Rows based on multiple criteria

 
 
cardioblack@gmail.com
Guest
Posts: n/a
 
      11th Jan 2007
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!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting rows based on criteria gbpg Microsoft Excel Programming 7 16th Aug 2008 05:23 AM
Deleting Rows Based on Criteria bgoode Microsoft Access Macros 1 24th Apr 2008 04:33 PM
Deleting excel rows based on multiple criteria suyog_linux Microsoft Excel Programming 2 18th Apr 2008 04:19 PM
Deleting blanks rows based on multiple criteria Pedros Microsoft Excel Programming 1 27th Jul 2006 05:44 AM
Deleting rows based on multiple criteria Sandip Shah Microsoft Excel Programming 3 12th Jul 2004 01:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:27 PM.