Remove rows based on two criteria

paulsolar

Well-known Member
Joined
Aug 21, 2013
Messages
684
Office Version
  1. 365
Hi All

I'm fine removing duplicate rows based on one criteria

Range("A:H").RemoveDuplicates Columns:=3, Header:=xlYes

But ideally I only want to remove rows where the data is duplicated for that row in column A & C elsewhere.

I hope I have explained this correctly. Been banging my head over this for hours

Any help would be appreciated

Cheers

Paul
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
The columns argument can be an array of column numbers that must be duplicated like so:
Range("A:H").RemoveDuplicates Columns:=Array(1, 3), Header:=xlYes
 
Upvote 0
Hi Joe,

That worked brilliantly, thanks so much. I had it just didn't think to call it an array.

Cheer

Paul
 
Upvote 0
quick question Joe

would it work with three criterion? for example Range("A:H").RemoveDuplicates Columns:=Array(1, 3, 4), Header:=xlYes
 
Upvote 0
quick question Joe

would it work with three criterion? for example Range("A:H").RemoveDuplicates Columns:=Array(1, 3, 4), Header:=xlYes
Certainly, ....and when in doubt try it out on a copy of your worksheet. :rolleyes:
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,094
Latest member
teemeren

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