Hi,
Can't figure out where exactly is the "type mismatch" error. The sumifs should return a double, don't know what type is Activecell.value. Or could it be some mismatch in the arguments-am I writing them correctly?
Please help if anyone has any ideas/solutions
Thanks
Code:
Dim CellVal As Double
Dim i As Long, j As Long
i = 3
j = 31
Worksheets("Jan").Cells(i, j).Activate
Do Until IsEmpty(Cells(i, j - 2))
CellVal = WorksheetFunction.SumIfs(Range("W2:W20000"), Range("S2:S20000"), Range("U2:U20000"), Cells(i, j - 2), Cells(1, j))
ActiveCell.Value = CellVal
i = i + 1
Cells(i, j).Activate
Loop