Hello!
Need your help to Sum with two matching criterias, I already have a macro but only works with one criteria.
I couldn't attach a sample file
Sample.jpg
Sub SumMatch()
Dim MainRow As Long
Dim AuxRow As Long
Dim MatchNum As Long
Dim KeyCol As Long
Application.ScreenUpdating = False
MainRow = 1
KeyCol = 2 'Matching Numbers In Column "B"
MatchNum = 0
Do While Cells(MainRow, KeyCol) <> ""
AuxRow = MainRow + 1
Do While Cells(AuxRow, KeyCol) <> ""
DelLoop:
If Cells(MainRow, KeyCol) = Cells(AuxRow, KeyCol) Then
Cells(MainRow, 5) = Cells(MainRow, 5) + Cells(AuxRow, 5) 'Sum In Column "E"
Rows(AuxRow).Delete: GoTo DelLoop
End If
AuxRow = AuxRow + 1
Loop
MainRow = MainRow + 1
MatchNum = 0
Loop
End Sub
Thanks in advance...
Bookmarks