I’m new to Excel and its VBA object model.
I have this table (A-D) sorted by A & B. For each A-B group of rows, I want to find the MAX D (Cost) value, and C (Sale-ID) of this max value. Like the smaller table (F1:J4). I mucked around with a pivot table, but can’t get the Sale-ID. [Ignore the formatting, added for ease of reading]
In any case I’m looking for a VBA solution. I’m sure that I could make work it, if I created a Range for each A-B group. But how? The closest thing I could find was this question: GroupBy and Sum rows using multiple columns in Excel, but that doesn’t give me the ID value, and seems rather unelegent.
Any pointers?