Hi,
I am trying to loop through a range to fill in a table of data using the sumifs function but I keep getting a type mismatch error.
I have attached the workbook. on the NB overview tab I am using the commission button to call the sub.
The figures in column A to E are the identifies for the month and year. the Raw data is all on the trans data tab
so far I have :
Sub NBComs()
Dim FigTab As Range
Dim Cell As Range
Dim Commission As Long
Set FigTab = Range("G3:K14")
For Each Cell In FigTab
Commission = Application.WorksheetFunction.SumIfs( _
Worksheets("Trans Data").Range("I:I"), _
Worksheets("Trans Data").Range("O:O") = "New", _
Worksheets("Trans Data").Range("R:R") = Cell.Offset(0, -6).Value)
Cell.Value = Commission
Next Cell
End Sub
Its probably something really simple that I'm missing but I haven't had much practice in calling worksheet functions
Thanks
Bookmarks