Hi everyone.
I am rather new to excel but since I am an IT major, I have some understanding of how the coding of this macro should work. However, I am not capable of writing this code on my own so I am asking for your help.
I have a spreadsheet with roughly 1000 lines. Within this spreadsheet, I have a list of suppliers (using unique supplier numbers), plants which have purchased from these suppliers, and how much each plant has purchased from these suppliers. Since multiple plants buy from the same suppliers, the supplier names come up 1 or more times within the spreadsheet with different plant buyers. I am needing a macro that will choose which plant has spent the most from a specific supplier, and pull that row of information into a new spread sheet or simply filter the data so it only displays the supplier and its highest buyer.
I have attached a small bit of the spreadsheet to show you what the columns look like (Raw.xlsx) and the numbers that I want pulled (Desired.xlsx).
My logic of how the macro should work is:
-Begin in column A and pick up the supplier number (unique).
-Go to the next row in column A and see if A2 matches A1
-If it matches, remember that and continue down until Ax != Ax+1
-Once the rows have been found with matching numbers for that supplier number, compare the values in column D, find the MAX, and pull/highlight that row.
-Once the row has been pulled/highlighted, continue to the next supplier number and repeat.
I prefer for the data to be pulled to a new spreadsheet since I will have to manually copy the highest values to another spreadsheet later on.
Please let me know if I am making sense or not, and thank you very much in advance.
Bookmarks