i = Worksheets("???").Range("c65536").End(xlUp).Row
For j = i To 1 Step -1
If Cells(j, 3).Value = Cells(j - 1, 3).Value And Cells(j, 6).Value = Cells(j - 1, 6).Value Then
Cells(j - 1, 8).Value = Cells(j - 1, 8).Value + Cells(j, 8).Value
Cells(j - 1, 9).Value = Cells(j - 1, 9).Value + Cells(j, 9).Value
Cells(j - 1, 11).Value = Cells(j - 1, 11).Value + Cells(j, 11).Value
Cells(j, 8) = ""
Cells(j, 9) = ""
Cells(j, 11) = ""
Else
Cells(j, 8).Value = Cells(j, 8).Value
Cells(j, 9).Value = Cells(j, 9).Value
Cells(j, 11).Value = Cells(j, 11).Value
End If
Next j
End With
End Sub
,可以运行但电脑提示if 语句语法错误
电脑提示if 的那行“应用程序定义的或对象定义的错误”
|