Deleting Rows Containing Reversed Names

AndyPaff

New Member
Joined
Jun 2, 2009
Messages
7
I have a worksheet in which one column of data contains pairs of competitor names which also appear reversed in the same column. E.g.


Alpha v Bravo
Alpha v Delta
Alpha v Echo
Bravo v Tango
Foxtrot v Delta
Delta v Alpha
Echo v Alpha
etc.


I require only one instance (row) of each pair of names (order of pair doesn't matter) and I would like to delete the surplus rows. How can I do this?


One way that springs to mind is to create an adjacent row with the names reversed (no problem). Then loop though this column one row at a time top to bottom looking for a match in the first column (nested loop of row +1 to bottom row) and deleting the row if matched. Would this work and what is the VBA I would need?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Perhaps you are definitely looking for a vba solution and that can certainly be done, but here is a fairly straight-forward manual way roughly based on the idea you were thinking of.

1. Copy this formula down column B
2. Use AutoFilter on column B & remove the tick from #N/A leaving just the numbered rows
3. Delete the visible rows below the headers.
4. Remove the AutoFilter

Excel Workbook
AB
1DataCheck
2Alpha v Bravo#N/A
3Alpha v Delta#N/A
4Alpha v Echo#N/A
5Bravo v Tango#N/A
6Foxtrot v Delta#N/A
7Delta v Alpha3
8Echo v Alpha4
Check matches
 
Upvote 0
Thank you for this Peter.


VBA isn't essential. Your solution takes seconds and can be automated using a macro I already have to insert formulas in other columns.

Vey much appreciated.


Andrew
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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