title: Need VBA code that retrieves sumproduct of particular rows and columns
body: <p>I'm wondering if someone can write me a VBA Code that retrieves the &quot;sumproduct&quot; of particular cells and columns. Here I have a screenshot of what I'm requesting.</p>
  <p><a href="https://i.stack.imgur.com/77Yth.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/77Yth.png" alt="enter image description here" /></a></p>
  <p>To explain what the code does: it finds particular text that matches the words &quot;ABC TOT&quot;, &quot;EFG TOT&quot;, and &quot;XYZ TOT&quot; in <strong>Column A</strong> PAIRED WITH a particular text matching the words &quot;THIS TITLE&quot; in a particular column (I'm using Column C for this example) and retrieves the &quot;total sum&quot; of those paired words. So it will mean:</p>
  <p>&quot;ABC TOT&quot; = 6</p>
  <p>&quot;EFG TOT&quot; = 9</p>
  <p>&quot;XYZ TOT&quot; = 6</p>
  <p>Which means: 6 + 9 + 6 = 21</p>
  <p>&quot;<strong>21</strong>&quot; is the resulting answer that I want input into a new cell. I can't just do <strong>C5 + C10 + C15</strong> because this is a spreadsheet with hundreds of rows &amp; columns and the location of all the numbers change every day. One day the numbers in C5 are going to end up in H7 (etc.) and that will be a problem. So this is why I need VBA Code to automate the task for me and retrieve the resulting answer based on specific row and column text alone. I made a diagram below that you can copy/paste.</p>
  <pre class="lang-none prettyprint-override"><code>       NOTTHISTITLE THISTITLE NOTTHISTITLE
  A                 0         1            0
  B                 1         0            4
  C                 2         5            1
  ABC TOT           3         6            5
  
  E                 0         0            1
  F                 2         2            1
  G                 2         7            0
  EFG TOT           4         9            2
  
  X                 1         3            4
  Y                 0         1            0
  Z                 1         2            3
  XYZ TOT           2         6            7
  </code></pre>