VBA to create a summary of three columns of data with two column criteria

KristenB

New member
Joined
Jan 2, 2020
Messages
35
Reaction score
0
Points
0
Excel Version(s)
365
I need to create a summary for data entry based on three columns. The three columns are project code, expense code and amount. My summary needs to summarize data in the manner of - each row with the same expense code and project code need to be summed in the summary. So, there might be 15 rows with 5 different project codes and the project codes may have the same expense code, and if they do, I need those to sum into a summary. Then, if the project code used in the first summary line has another entry, but with a different expense code, I need it to see if that expense code and project code set have others that need to be added to them and summed in the new amount column. This is hard to explain but if you look at the attached image you can see the data in the left of the spreadsheet... and I need it to summarize as I have manually summarized the data on the right side of the spreadsheet image:

Can anyone tell me how to make this happen using VBA?
 
Administrative Note:

Welcome to the forum. :)

We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

Read this to understand why we (and other sites like us) consider this to be important.

https://www.excelforum.com/excel-pr...ont-copy-data-in-row-if-a-field-is-empty.html
 
What I posted on the other site was different. This forum I am asking how to create the summary, the other forum I simply asked how to copy fields only if all three fields were not blank. I did not ask how to create the summary because I was awaiting a response from this forum when I realized that the blank fields would be an issue. You can see by my link below that the question was completely different. This post is asking how to create the summary, my other post is only asking how to remove cells of data if one of the cells is blank. If the post is being denied based on the image posted, that was an error in that post as it wasn't even valid. However, I didn't know how to remove that image.

https://www.excelforum.com/excel-pr...ont-copy-data-in-row-if-a-field-is-empty.html
 
Thank you. I have ended up using a work-around for the summary request. I merged two of the fields using concatenate to a separate range which allowed me to then use a pivot table without such a 'scary' result to parse through. I am still waiting for a response on my other post though in order to improve the pivot table but it will work as I have it for now. I'm sorry that the image caused it to appear that I had crossposted. It was not my intention and I would certainly have noted that I had crossposted if I had.
 
Back
Top