VB Question

davidhall80

Well-known Member
Joined
Jul 8, 2006
Messages
663
I've got the names of people that come through on a report every week. I keep this list on a tab called "Delete People" in column A. I would like that if there is a name in column A on Sheet 1 that is also on my delete Tab...to Delete the entire Row. Any suggestions?? Thanks in advance.
 

Some videos you may like

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
maybe this will do

Code:
Sub deletepeople()
With Sheets("Sheet1")
LR = .Cells(Rows.Count, "A").End(xlup).Row

For i = LR to 1 step - 1
    If WorksheetFunction.Countif(Sheets("Delete People").Range("A:A"), .Cells(i, "A").Value) > 0 Then 
        .Rows(i).EntireRow.Delete
    End If
Next i
End With
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,123,123
Messages
5,599,834
Members
414,341
Latest member
Mohammedsobhey

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
Top