Looking to Delete Rows in Sheet based on cells in another Sheet

Rocket89

New Member
Joined
Aug 6, 2013
Messages
5
Hello,
I am looking for help with a macro, or a entirely new macro. Here is my situation:
I have a list of data (Sheet2)
I have a list of terms in Sheet 1 that i need to delete the entire row from Sheet 2. The macro provided works but it seems to only delete the first time each of the terms listed on sheet 1 appears on sheet 2. In turn i have to run the macro about 50-75 times to remove all the terms that i want deleted. The data in Sheet 2 is updated and refreshed every 6 days so having to run the macro 50 times seems to be a bit impractical. Below is the macro i've been using, if you want to "tweek" it feel free to or if you have one that works better. let me know.


Sub delete()
Application.ScreenUpdating = False
Dim rFound As Range
On Error Resume Next
For Each cell In Sheets("Sheet1").Range("A1:A99" & Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row)
With Sheets("Sheet2").Columns(1)
Set rFound = .Find(What:=cell, After:=.Cells(1, 1), LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False)
If Not rFound Is Nothing Then
.Cells(rFound.Row, rFound.Column).EntireRow.delete xlUp
End If
End With
Next cell
Application.ScreenUpdating = True
End Sub


Thanks!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,223,248
Messages
6,171,021
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top