Need a delte rows macro (based on a criteria)

mortgageman

Well-known Member
Joined
Jun 30, 2005
Messages
2,015
Hi all -

I have a spreadsheet that looks similar to this

Course Name Other1 Other2 Id
Math a b 123
Math II a b 123
Math 1 a b 456

I want to delete any rows that do not repeat the ID

Any ideas?

Gene Klein
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
You can put a helper column in:

=CountIF($E$2:$E$65536,E2)

Where E2 is the first ID value. Then filter on Count of 1. This is probably one of many other ways. You could also sort by ID and use an IF formula to mark ID's that are the same as the ID above it. Office 2007 introduced a Find Duplicates tool though I personally haven't used it yet (dunno why not). Finally, you can drop it into Access for a quick job with SQL.
 
Upvote 0
You can put a helper column in:

=CountIF($E$2:$E$65536,E2)

Where E2 is the first ID value. Then filter on Count of 1. This is probably one of many other ways. You could also sort by ID and use an IF formula to mark ID's that are the same as the ID above it. Office 2007 introduced a Find Duplicates tool though I personally haven't used it yet (dunno why not). Finally, you can drop it into Access for a quick job with SQL.

I will try these when I get to work tommorow. Thank you

Gene Klein
 
Upvote 0

Forum statistics

Threads
1,224,557
Messages
6,179,508
Members
452,918
Latest member
Davion615

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