View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] cardioblack@gmail.com is offline
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!