打开EXCEL ALT+F11 调出VBA 插入菜单 插入模块 复制下面的 Sub tt() Application.DisplayAlerts = False Dim i, a As Integer a = 1 For i = 1 To [A1].End(xlDown).Row If Cells(i, 1) = Cells(i + 1, 1) Then Else Range(Cells(a, 1), Cells(i, 1)).Merge Range(Cells(a, 2), Cells(i, 2)).Merge a = 1 + i End If Next i Application.DisplayAlerts = True End Sub