I’m searching for an way in VBA to sum up values based on another Cell’s value
Example Source Table:
BillNr Pos Value
200 0 sum
200 1 10,00 €
200 2 15,00 €
200 3 31,00 €
200 4 21,00 €
200 5 19,00 €
200 6 81,00 €
201 0 sum
201 1 14,00 €
201 2 18,00 €
212 0 sum
212 1 31,00 €
212 2 19,00 €
212 3 78,00 €
Depending on the Number in BillNr the VBA Code should sum all Values in Value and show that Number in the Cell which is called sum. In reality the List is something about 15000 rows long so I guess it needs to get wrapped in loop?
Take your pick 🙂
VBA
Screenshot
Non VBA (Using Pivot and Vlookup)
I am using
Vlookupin Col D after creating the Pivot. You can setAutofilterinCol Cto filter onsumand then put the formula in relevant cells inCol C