Newbie VBA: "Object required" error in "Sumif" command
<p>Pretty much new to VBA. Looking to do a simple SumIF from Excel, but having trouble with 424 errors, "Object Required". </p>

<p>My simple code is the following:</p>

<pre><code>Sub Example1()

Dim TestVar As Long
Set TestVar = Application.WorksheetFunction.SumIf( _
                Arg1:=Sheet1.Range("B2:B11"), _
                Arg2:="1", _
                Arg3:=Sheet1.Range("A2:A11"))

End Sub
</code></pre>

<p>Hope any one can point out the mistake here.</p>

<p>Best, </p>

<p>ID</p>

<p>Follow-up question:</p>

<pre><code>For i = 1 To 10

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

Next i
</code></pre>

<p>I get the following error message: Run-time error 13. Type Mismatch</p>