然后在弹出的模块窗口中,输入如下VBA代码:
Sub Macro1()
' Macro1 Macro
' 快捷键: Ctrl+Shift+A
Application.Goto Reference:="Macro1"
Application.DisplayAlerts = False
For i = [A65536].End(3).Row To 2 Step -1
If Cells(i - 1, 1) = Cells(i, 1) Then
Range(Cells(i - 1, 1), Cells(i, 1)).Merge
End If
Next
Application.DisplayAlerts = True
End Sub