This is for my school project. I was given a worksheet with some inventory info. What I have to do is create a user-interface in another sheet, that will summarize that inventory data. I have created a list box with the names of all the vendors from the inventory sheet, and now I have to get it to work. A user after clicking a vendor's name (in the listbox) should see the total cost of its products, total quantity and average cost displayed next to the list box... and I have no clue how to write that in VBA code.
I have come up with a little plan:
- I need a "for" loop that will search through every row in the inventory sheet
- it somehow has to compare the selected name to the Name column in the Inv. sheet
- it also has to select the cost and quantity of the vendor
- then I need to sum up these values to get my totals
- I also need a variable that will count the number of selected rows (to get the average cost)
Can anyone help me out? I would really appreciate it.
Thanks.