Hi!
I am trying to adapt my SUMIF vba code introducing another criteria but I cannot manage to do it.
The code I was using and was running okay is:
Sub SumIf()
Dim Sumact As Range
Dim wsWeeklyProduction As Worksheet
Dim wsTrips As Worksheet
Set wsWeeklyProduction = Sheets("Weekly Production")
Set wsTrips = Sheets("Trips")
Set Sumact = wsWeeklyProduction.Cells(27, "G")
Sumact = Application.SumIf(wsTrips.Range("C12:C65536"), wsWeeklyProduction.Cells(12, "H").Value, wsTrips.Range("V12:V65536"))
End Sub
This runs perfect when:
wsTrips.Range("C12:C65536") = wsWeeklyProduction.Cells(12, "H").Value
But I would like to run this with 2 criteria instead, something like:
wsTrips.Range("C12:C65536") = wsWeeklyProduction.Cells(12, "H").Value and wsTrips.Range("H12:H65536") = wsWeeklyProduction.Cells(26, "B")
Then SUM the cells from wsTrips.Range("V12:V65536")
Any help would be much appreciated.
Thankss!
Regards
Bookmarks