title: Aggregate array of custom type along one of its variables?
body: <p>I have a custom type:</p>
  
  <pre><code>Private Type invoiceLine
      itemCode As String
      packageSize As String
      englishName As String
      boxName As String
      weight As Double
      pieces As Double
  End Type
  </code></pre>
  
  <p>I want to sum weight and pieces to get the sum for each unique itemCode. </p>
  
  <p>Example:
  I have items with </p>
  
  <pre><code>itemCode=1564, weight=2, pieces=3
  itemCode=1564, weight=1, pieces=1
  itemCode=1564, weight=3, pieces=1
  itemCode=3333, weight=2, pieces=4
  </code></pre>
  
  <p>I want ot aggregate this to get:</p>
  
  <pre><code>itemCode=1564, weight=6, pieces=5
  itemCode=3333, weight=2, pieces=4
  </code></pre>
  
  <p>How can I do this? </p>