vendredi 5 août 2016

Several arguments in SumIF in VBA?

In cont. of a previous questions, I am looking to include several statements in a sumif command. Can that be done by using something similar to this code:

For i = 1 To 10

Range("G" & i + 1).Value = Application.WorksheetFunction.SumIfs( _
        Arg1:=Ark1.Range("A2:A11") And Ark1.Range("B2:B11"), _
        Arg2:=Range("A" & i + 1) And "a", _
        Arg3:=Ark1.Range("C2:C11"))

 Next i

I get the following error message: "Run-time error 13. Type Mismatch"

Aucun commentaire:

Enregistrer un commentaire