Hello Forum and thank you very much in advance for taking a look at my request for VBA code to solve a business problem...
I'm working on a profitability report by analyzing expenses and revenues of customers by customer owner. I have a data set of hundreds of thousands of rows that contain customers (column A), customer owners (column B), dollars in expenses (column C), and dollars in revenues (column D). There are one or more customers for each customer owner (so I fully expect there to be multiple instances of results in the output for owners with more than one customer). Each customer has its own expense and revenue dollar amount.
I would like to create a macro button that does the following. For each customer owner, lookup all of their associated customers then:
1. Total the customer expenses (C) for that customer owner and place that total in column E for that customer owner ID in that row, and
2. Total the customer revenues (D) for that customer owner and place that total in column F for that customer owner ID in that row
Again, expectation is that there will be duplicate values in columns E and F where a customer owner has more than one customer. I have attached a sample workbook that demonstrates the expected results in columns E and F. Note the actual workbook will not necessarily have the data in adjacent columns, so absolute references are likely preferred (as if I know what I'm even talking about! ).
Thanks so much and please let know if I can clarify anything better than I have here already.
Regards,
Chris
Bookmarks