title: Using Excel VBA, how do I calculate a sum based on other conditions in that row?
body: <p>I'd like help with a macro to look at columns A and C in the current row and then search the sheet I'm on for matches to both columns A and C. If the row matches both columns, the macro would then add column E. I then want the sum to output in column F.</p>
  
  <ul>
  <li>Look columns A and C of current row</li>
  <li>Find all rows with matching columns A <em>and</em> C</li>
  <li>For all rows that had a match, sum up their cells in column E and display them in all of their column F's</li>
  </ul>
  
  <p>I was thinking that I would create a string to compare A and C, but I don't know how to do a sum if the conditions are met.</p>
  
  <p>Here's the idea I started with:</p>
  
  <pre><code>strCriteria = Cells(.Row, "A"), Cells(.Row, "C").Value
  Do While Cells(.Row, "A"), Cells(.Row, "C").Value = strCriteria
  </code></pre>
  
  <p>Any pointers or ideas would be much appreciated!</p>