Sub 合并内容相同的连续单元格()
Dim i As Integer
Dim Rng As Range
On Error Resume Next
Application.DisplayAlerts = False
With Selection
For i = .Cells.Rows.count To 1 Step -1
If .Cells(i - 1, 1).Value = .Cells(i, 1).Value Then
Set Rng = Union(.Cells(i - 1, 1), .Cells(i, 1))
Rng.Merge
Set Rng = Nothing
End If
Next
End With
Application.DisplayAlerts = True
End Sub