Copy & Paste Values in Single Cells to Merged Cells via VBA

browncountry

New Member
Joined
Feb 2, 2019
Messages
13
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[TD]J
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Kit P/N
[/TD]
[TD]Kit S/N
[/TD]
[TD]Kit Part
[/TD]
[TD]Kit Parts S/N
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Kit P/N
[/TD]
[TD]Kit S/N
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Kit 1
[/TD]
[TD]123
[/TD]
[TD]Part 1
[/TD]
[TD]001
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Kit 1
[/TD]
[TD]123
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD][/TD]
[TD][/TD]
[TD]Part 2
[/TD]
[TD]002
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Kit 2
[/TD]
[TD]456
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD][/TD]
[TD][/TD]
[TD]Part 3
[/TD]
[TD]003
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Kit 3
[/TD]
[TD]789
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]Kit 2
[/TD]
[TD]456
[/TD]
[TD]Part 1
[/TD]
[TD]004
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD][/TD]
[TD][/TD]
[TD]Part 2
[/TD]
[TD]005
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]Kit 3
[/TD]
[TD]789
[/TD]
[TD]Part 1
[/TD]
[TD]006
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8
[/TD]
[TD][/TD]
[TD][/TD]
[TD]Part 2
[/TD]
[TD]007
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9
[/TD]
[TD][/TD]
[TD][/TD]
[TD]Part 3
[/TD]
[TD]008
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10
[/TD]
[TD][/TD]
[TD][/TD]
[TD]Part 4
[/TD]
[TD]009
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

If anyone has some time to help, I would like to be able to copy & paste values from single cells into merged ones via VBA. I can do this manually, but it gets tedious even with formulas.

In the table above, imagine Kit 1 is merged from A2:A4 and Kit 1 S/N is merged from B2:B4, Kit 2 is merged from A5:A6 and Kit 2 S/N is merged from B5:B6, and Kit 3 is merged from A7:A10 and Kit 3 S/N is merged from B7:B10.

The amount of kits vary on any particular sheet. I have formulas that create serial numbers for Columns I and J. I would like to select all serial numbers in Column J into the corresponding merged cells of Column B. Please help if you can. This would be a big time saver for me. Thanks in advance.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

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