макрос для выполнения автоматического объединения ячеек:
Sub MergeCells()
Dim j As Long
Dim i As Long
Application.DisplayAlerts = False
For j = 1 To Selection.Columns.Count
For i = Selection.Rows.Count To 2 Step -1
If Selection.Cells(i - 1, j) = Selection.Cells(i, j) Then
Range(Selection.Cells(i - 1, j), Selection.Cells(i, j)).Merge
End If
Next
Next
Selection.VerticalAlignment = xlVAlignCenter
Application.DisplayAlerts = True
End Sub
![](https://s2.save4k.ru/pic/ErVvWrAZ6_8/maxresdefault.jpg)