title: how can I use two variables inside a sumproduct formula in vba?
body: <p>I have two tables and three variables as below in one sheet</p>
  <ol>
  <li>LastSize for the number of last column of my first table</li>
  <li>LastMat for the number of last column of my second table</li>
  <li>LastProduct for the number of last row of my first and second table (both are equal)</li>
  </ol>
  <p>I want to use them in a sumproduct function in VBA but I don't know how to write it.</p>
  <p>To help you get my problem:</p>
  <ul>
  <li>to_char is a function that turn the number of a column to its word (like: to_char(3) is D)</li>
  <li>I is a counter for my loop</li>
  </ul>
  <blockquote>
  <pre><code>&quot;=sumnproduct(&quot;LastSize&quot;5:&quot;LastSize&quot;&quot;LastProduct&quot; , &quot;to_char(I)&quot;5:&quot;to_char(I)&quot;&quot;LastProduct&quot;)
  </code></pre>
  </blockquote>