Offset merged cells

Rolly_Sefu

Board Regular
Joined
Oct 25, 2013
Messages
149
Hello.

I have the following table:

Column B is a merged cell, ( 4 rows merged into once cell)

I am trying to get the value 2 from column A by and value 4 from column A by offsetting the merged cell of column B

x = Range("M8").MergeArea.Offset(1, -1)

M8 = my merged cell

so I would need to get the values for L9 and L11

But this does not give me a good result, always returns the value as a merged cell.

Any ideas ?

Thanks.
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
There is a reason that one avoids merged cells.

If M8:M11 are merged, this ungainly expression returns the array of values from L9:L12.
Note that the Offset has been broken into two parts.

Code:
With Range("M8")
    With .Offset(0, -1).Resize(.MergeArea.Rows.Count, 1)
    
        MsgBox Join(Application.Transpose(.Offset(1, 0).Value))
        
    End With
End With
 
Upvote 0
Hello.

Thanks for the reply.

I managed to make this line: "Range(Range("M8").Offset(0, -1).Address).Offset(1, 0)"

Witch one for the 2 versions mine or yours is better ?

Thanks.
 
Upvote 0

Forum statistics

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