Extract value from merged cells in two or more rows

akalien

New Member
Joined
Jul 2, 2010
Messages
21
Office Version
  1. 2019
Platform
  1. Windows
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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
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
 
Upvote 0
Solution

Forum statistics

Threads
1,215,733
Messages
6,126,541
Members
449,316
Latest member
sravya

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