title: VBA coding for Sumproduct() function with condition and named column range
body: <p>Excel 2013
  I am trying to use my excel sumproduct function in VBA but no luck. 
  I have two formulas one is without condition that work fine in VB but the other one with condition is not working. Here are the formulas </p>
  
  <p>formula with no condition work fine in Excel </p>
  
  <pre><code>=SUMPRODUCT(tblProduct[Qty],tblProduct[amount])
  </code></pre>
  
  <p>and its VBA code that working fine in VBA excel userform</p>
  
  <pre><code>vGrndTot = Application.SumProduct(Range("tblProduct[Qty]"), Range("tblProduct[amount]"))
  </code></pre>
  
  <p>Conditional SUMPRODUCT working fine in excel</p>
  
  <pre><code>=SUMPRODUCT(--(tblProduct[prodID]="XYZ"),tblProduct[Qty],tblProduct[amount])
  </code></pre>
  
  <p>and its VBA code that i am tying to use but it not work (error type missmatch)</p>
  
  <pre><code>vTot = Application.SumProduct(--(Range("tblProduct[prodID]") = "XYZ"), Range("tblProduct[Qty]"), Range("tblProduct[amount]"))
  </code></pre>
  
  <p>any hint what I am doing wrong ?
  I read so many question some said use evaluate (that too didn't work) some said use +0, or * 1 but i had no luck. </p>