copy selection and paste to end of row if 4 criteria are met

Youngdand

Board Regular
Joined
Sep 29, 2017
Messages
123
Hi,

I am struggling with the below problem.

I have a set of data which is 18 columns long and could have many rows.

the data may have many similar items.

For each item where columns a,d,g,h,i,j,k,l,m match another row within the sheet, i need to cut the range a to r to the end of the row containing the first instance, and subsequent matches should be pasted again to the end of this row and so on. below is a small example of the data.

for example row 2 should be pasted to the end of row 1. row 7 should be added to the end of row 6, and row 8 should be added at the end of this.


Can anyone help with this?


AB
CDEFGHIJKLMNOPQR
1Company 1123456987654AB64VBAName 1Add1Add2Add3Add4Add5PcodeSome infoMore info27/06/201716025/07/2017
2Company 1234567876543AB64VBAName 1Add1Add2Add3Add4Add5PcodeSome infoMore info26/06/201716024/07/2017
3Company 2345678765432AB64VBAName 1Add1Add2Add3Add4Add5PcodeSome infoMore info06/07/201713503/08/2017
4Company 2456789654321BC17CLJName 2Add1Add2Add3Add4Add5PcodeSome infoMore info05/07/201713502/08/2017
5Company 2567890543210
BC17CLJ
Name 2DiffAdd1
DiffAdd2DiffAdd3DiffAdd4DiffAdd5DiffPcodeSome infoMore info29/06/201713527/07/2017
6Company 3678901432109DE57ZTDName 3Add1Add2Add3Add4Add5PcodeSome infoMore info07/07/201713504/08/2017
7Company 3789012321098
DE57ZTD
Name 3Add1Add2Add3Add4Add5PcodeSome infoMore info13/06/201716011/07/2017
8
Company 3
890123
210987
DE57ZTD

<tbody>
</tbody>
Name 3
Add1Add2Add3Add4Add5PcodeSome infoMore info
03/08/201716031/08/2017
9Company 4901234
109876EF57ZBCName 4Add1Add2Add3Add4Add5PcodeSome infoMore info06/06/201716004/07/2017

<tbody>
</tbody>
Sheet1
 
HI Fluff,

In the end it threw an Run-time error -2147417878(80010108)
Automation Error
The Object Invoked had disconnected from its clients.

Any idea why this maybe? For reference i am using Excel 2016 64bit
 
Last edited:
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Just tested on ~4500 & it took under a minute. Do you have any event code that might be interfering?
I've no idea why you'd get that error, unless there is something else going on in the background.
 
Upvote 0
Just tested on ~4500 & it took under a minute. Do you have any event code that might be interfering?
I've no idea why you'd get that error, unless there is something else going on in the background.

After a restart and copying the data to a new workbook, it worked flawlessly and fast. Not sure which fixed it, but it works perfectly.

Thanks a million.
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,216,100
Messages
6,128,824
Members
449,470
Latest member
Subhash Chand

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