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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
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