Sub 宏1()
Dim i As Long, lastr As Long
Application.DisplayAlerts = False
lastr = Cells(Cells.Rows.Count, 1).End(xlUp).Row
For i = lastr To 3 Step -1
If Cells(i, 2) = "" Then
Range(Cells(i, 2), Cells(i - 1, 2)).Merge
Range(Cells(i, 3), Cells(i - 1, 3)).Merge
Range(Cells(i, 5), Cells(i - 1, 5)).Merge
End If
Next
Application.DisplayAlerts = False
End Sub
Dim i As Long, lastr As Long
Application.DisplayAlerts = False
lastr = Cells(Cells.Rows.Count, 1).End(xlUp).Row
For i = lastr To 3 Step -1
If Cells(i, 2) = "" Then
Range(Cells(i, 2), Cells(i - 1, 2)).Merge
Range(Cells(i, 3), Cells(i - 1, 3)).Merge
Range(Cells(i, 5), Cells(i - 1, 5)).Merge
End If
Next
Application.DisplayAlerts = False
End Sub