Hi

AWB.sSh.Range("A8:A" & lastRow)
This syntax is wrong. sSh is not a method or a property of AWB.

If you defined sSh as a worksheet in workbook AWB, use instead:

cell.Offset(0, 3) = Application.WorksheetFunction.SumIf(sSh.Range("A8:A" & lastRow), cell.Value, sSh.Range("G8:G" & lastRow))
This should work. If it doesn't please post the initialisation of AWB and sSh.