Sub 条件统计()
Dim refg As String
refg = ActiveSheet.UsedRange.Item(ActiveSheet.UsedRange.Count).Row
Range("B3:C4") = 0
For R = 3 To 4
For C = 2 To 3
For i = 3 To refg
If Cells(R, 1) = Cells(i, 5) And Cells(2, C) = Cells(i, 6) Then
Cells(R, C) = Cells(R, C) + Cells(i, 7)
End If
Next
Next
Next
End Sub
有附件