|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub 按钮1_Click()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For j = Cells(Rows.Count, 2).End(3).Row To 4 Step -1
If Cells(j, 2) = Cells(j - 1, 2) Then
Cells(j - 1, 2).Resize(2).Merge
Cells(j - 1, 4) = Cells(j - 1, 4) + Cells(j, 4)
Cells(j - 1, 4).Resize(2).Merge
If Cells(j, 3) = Cells(j - 1, 3) Then
Cells(j - 1, 3).Resize(2).Merge
For i = 5 To 5
Cells(j - 1, i) = Cells(j - 1, i) + Cells(j, i)
Cells(j - 1, i).Resize(2).Merge
Next i
End If
End If
Next j
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
|
评分
-
2
查看全部评分
-
|