Order a rows in a sheet by copying and pasting rows to new sheet

capson

Board Regular
Joined
Jul 9, 2010
Messages
107
Hello,

In sheet1, in column A I have a unique list of names (of variable length)


I run a similarity algorithm on this column and get in column B the closest non-identical match to the name in column A for each row


Because the Fuzzy match was on a list to itself each match has a corresponding match in column A


e.g.
Code:
[TABLE="width: 345"]
<tbody>[TR]
[TD]Name[/TD]
[TD]FM_Name[/TD]
[/TR]
[TR]
[TD]Kathryn Hall Trujillo[/TD]
[TD]Kathryn Hall-Trujillo[/TD]
[/TR]
[TR]
[TD]Kathryn Hall-Trujillo[/TD]
[TD]Kathryn Hall Trujillo[/TD]
[/TR]
[TR]
[TD]Giselle Corbie-Smith[/TD]
[TD]Gisselle Corbie-Smith[/TD]
[/TR]
[TR]
[TD]Gisselle Corbie-Smith[/TD]
[TD]Giselle Corbie-Smith[/TD]
[/TR]
</tbody>[/TABLE]

If the spellings differences are very small the match and its corresponding match are in adjacent rows as above

But if the names have a greater degree of difference then they are separated by multiple rows

e.g.
Code:
[TABLE="width: 305"]
<tbody>[TR]
[TD]Name[/TD]
[TD]FM_Name[/TD]
[/TR]
[TR]
[TD]Dr. Veronica Womack[/TD]
[TD]Veronica Womack[/TD]
[/TR]
[TR]
[TD]…[/TD]
[TD]…[/TD]
[/TR]
[TR]
[TD]…[/TD]
[TD]…[/TD]
[/TR]
[TR]
[TD]…[/TD]
[TD]…[/TD]
[/TR]
[TR]
[TD]…[/TD]
[TD]…[/TD]
[/TR]
[TR]
[TD]Veronica Womack[/TD]
[TD]Dr. Veronica Womack[/TD]
[/TR]
</tbody>[/TABLE]

I need in Sheet2 the rows such that all pairings are adjacent
e.g.
Code:
[TABLE="width: 305"]
<tbody>[TR]
[TD]Name[/TD]
[TD]FM_Name[/TD]
[/TR]
[TR]
[TD]Kathryn Hall Trujillo[/TD]
[TD]Kathryn Hall-Trujillo[/TD]
[/TR]
[TR]
[TD]Kathryn Hall-Trujillo[/TD]
[TD]Kathryn Hall Trujillo[/TD]
[/TR]
[TR]
[TD]…[/TD]
[TD]…[/TD]
[/TR]
[TR]
[TD]…[/TD]
[TD]…[/TD]
[/TR]
[TR]
[TD]Giselle Corbie-Smith[/TD]
[TD]Gisselle Corbie-Smith[/TD]
[/TR]
[TR]
[TD]Gisselle Corbie-Smith[/TD]
[TD]Giselle Corbie-Smith[/TD]
[/TR]
[TR]
[TD]…[/TD]
[TD]…[/TD]
[/TR]
[TR]
[TD]…[/TD]
[TD]…[/TD]
[/TR]
[TR]
[TD]Dr. Veronica Womack[/TD]
[TD]Veronica Womack[/TD]
[/TR]
[TR]
[TD]Veronica Womack[/TD]
[TD]Dr. Veronica Womack[/TD]
[/TR]
[TR]
[TD]…[/TD]
[TD]…[/TD]
[/TR]
[TR]
[TD]…[/TD]
[TD]…[/TD]
[/TR]
[TR]
[TD]…[/TD]
[TD]…[/TD]
[/TR]
[TR]
[TD]name_last[/TD]
[TD]Fm_name_last[/TD]
[/TR]
[TR]
[TD]Fm_name_last[/TD]
[TD]name_last[/TD]
[/TR]
</tbody>[/TABLE]



And I need the entire Row moved as there is a variable number of columns with data after column B

Thank you in advance for help on this, I have got nowhere with this myself
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,216,458
Messages
6,130,757
Members
449,588
Latest member
accountant606

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