|
|
#12 |
|
Moderator
|
Цитата:
Код:
Sub Macro22()
Dim rng As Range
Set rng = Range("B2:C4")
If rng.MergeCells Then
Set rng = rng.Range("A1").MergeArea
End If
rng.Insert xlShiftDown 'где константа xlShiftDown = -4121
rng.Copy rng.Offset(-rng.Rows.Count)
End SubP.S. Соответственно, добавка в метод: X++: if (comRange.MergeCells()) { comRange = comRange.Range('A1'); comRange = comRange.MergeArea(); } |
|
|