title: SUMIF as a macro in Excel (VBA)
body: <p>So this is the concept I'm working with.</p>
  
  <p>I have Sheet1 with many keys and values on it:</p>
  
  <p><img src="https://i.stack.imgur.com/hBuEH.png" alt="enter image description here"></p>
  
  <p>Then on sheet2 I have been using a SUMIF function to work out the total values from sheet1:</p>
  
  <p><img src="https://i.stack.imgur.com/NKlnU.png" alt="enter image description here"></p>
  
  <p>This is just an example and the actual datasets are much larger. I need to design a macro that will automatically generate and insert the SUMIF formula into the correct cells in sheet2. Can anyone think of a way to do this? </p>