Extract value from merged cells in two or more rows

akalien

New Member
Joined
Jul 2, 2010
Messages
15
Hi,

I have a sheet with merged and non merged cells in column C and I want to extract the value from the merged cells into two or more other cells in column D corresponding to the size of the merged cell.

Value 001 into D2 and D3
Value 008 into D4, D5, D6, D7 and D8
...
If there is a non merged cell the value from column C should also be copied to column D.

Many thanks in advance for your help.
AK

Merged cells.PNG
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Tupe77

Board Regular
Joined
Nov 26, 2020
Messages
100
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
This is written on a cell phone, so I haven’t tested this.

Select from column range where merged cells are.

VBA Code:
sub TS_CopyMerge()
dim SrcRNG as range, Cell as range
Set SrcRNG=Selection

For Each Cell In SrcRNG
        cell.address.offset(0,1).value=Cell.MergeArea(1).Value
Next
end sub
 
Solution

Forum statistics

Threads
1,136,276
Messages
5,674,790
Members
419,525
Latest member
mountainkids

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
Top