PDA

View Full Version : [SOLVED:] Unmerge cells across rows only not across columns



YasserKhalil
08-02-2017, 02:15 PM
Hello everyone
I have merged cells across columns .. In attachment : Columns B:F are merged & columns G:K are merged & columns L:S are merged
My request is to keep the merged cells across columns but to unmerge cells across rows (as in the yellow range)
the yellow range is B3:F6 and I need to unmerge that part (this is just an example as I have a lot of parts) ...The final result would be :
B3:F3 (To be merged) & B4:F4 (To be merged) & B5:F5 (To be merged) & B6:F6 (To be merged)

Hope it is clear
Thanks advanced for any help

mdmackillop
08-02-2017, 03:26 PM
Sub Test()
For Each cel In ActiveSheet.UsedRange
If cel.MergeArea.Rows.Count > 1 Then
Set r = cel.MergeArea
r.UnMerge
For i = 1 To r.Rows.Count
r.Rows(i).Merge
Next
End If
Next
End Sub

YasserKhalil
08-02-2017, 03:40 PM
That's awesome Mr. MD
Thank you very much for this fascinating solution ...
Regards