VBA: Delete row if not match list

gd6noob

Board Regular
Joined
Oct 20, 2017
Messages
170
Office Version
  1. 2016
Platform
  1. Windows
Hope everyone is well.

I have a workbook that has 2 sheets.
Sheet1 will have rows delete if Column A is not found on Sheet2 Column A. Sheet2 has around 15-20 criteria's
I tried using Autofilter but it takes some time to complete. My data is anywhere from 60k-100k rows and generally half of that needs to be deleted.

Is there a more efficient way to go about this?

Regards,
gd6noob
 
100k rows
1st Run: 0.917
2nd Run: 0.921
3rd Run: 1.021
It doesn't really matter, but I was actually referring to the two different codes, since you said "both" worked. :)
.. and are those units seconds?
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
It doesn't really matter, but I was actually referring to the two different codes, since you said "both" worked. :)
.. and are those units seconds?
It was very close between the 2 codes that worked and yes, those would be in seconds.
 
Upvote 0
OK, thanks for the clarification. Glad they worked for you! :)
 
Upvote 0

Forum statistics

Threads
1,223,532
Messages
6,172,875
Members
452,486
Latest member
standw01

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