Possibly, I'll repost the code with some comments inserted. If after
making the changes below the code still does not run, post back with
the line that isn't working and if possible something that will give
an idea of where your data begins on the Commissions sheet.
Sub SummarizeComm()
Dim wb As Workbook
Dim wsComm As Worksheet
Dim wsSum As Worksheet
Dim rColTwo As Range
Dim rCell As Range
Dim strColOne As String
Dim strColTwo As String
Dim lngColThree As Long
Dim lngColFour As Long
Dim intSumRow As Integer
Set wb = ActiveWorkbook
Set wsComm = wb.Worksheets(1)
Set wsSum = wb.Worksheets(2)
'Change the following (2,2) reference to the location of the first
data cell in what you referred to as 'Col 2'.
' the (2,2) is (row#,column#). Also, I should note that the following
line of code depends on there being no gaps or empty cells
' in the 'Col 2' data
Set rColTwo = wsComm.Range(Cells(2, 2), Cells(2, 2).End(xlDown))
'Change the following (2,2) reference to the location of the first
data cell in what you referred to as 'Col 2'.
' the (2,2) is (row#,column#)
strColOne = Cells(2, 2).Offset(0, -1).Value
strColTwo = Cells(2, 2).Value
wsSum.Range("B1").Value = strColOne
intSumRow = 2
For Each rCell In rColTwo
If rCell.Value = strColTwo And rCell.Offset(0, -1).Value =
strColOne Then
lngColThree = lngColThree + rCell.Offset(0, 1).Value
lngColFour = lngColFour + rCell.Offset(0, 2).Value
ElseIf rCell.Value <> strColTwo And rCell.Offset(0, -1).Value =
strColOne Then
wsSum.Cells(intSumRow, 1).Value = strColTwo
wsSum.Cells(intSumRow, 3).Value = lngColThree
wsSum.Cells(intSumRow, 4).Value = lngColFour
lngColThree = 0
lngColFour = 0
strColTwo = rCell.Value
lngColThree = rCell.Offset(0, 1).Value
lngColFour = rCell.Offset(0, 2).Value
intSumRow = intSumRow + 1
Else
intSumRow = intSumRow + 2
wsSum.Cells(intSumRow, 2) = rCell.Offset(0, -1).Value
strColOne = rCell.Offset(0, -1).Value
strColTwo = rCell.Value
lngColThree = 0
lngColFour = 0
lngColThree = rCell.Offset(0, 1).Value
lngColFour = rCell.Offset(0, 2).Value
intSumRow = intSumRow + 1
End If
Next rCell
wsSum.Cells(intSumRow, 1).Value = strColTwo
wsSum.Cells(intSumRow, 3).Value = lngColThree
wsSum.Cells(intSumRow, 4).Value = lngColFour
End Sub