I think this will do what you want. I wrote it assuming that you were working on Sheet1, you will have to adjust where needed.
You said that you were new to this so:
1) Back-up your workbook somewhere safe, in case the idiot from the internet (that would be me) is wrong.
2) Open a new Excel session with your test version of the workbook.
3) Use Tools - Macro - Visual Basic Editor to open the VB editor.
4) Use the Insert menu to insert a Module (not a Class Module).
5) Copy the first batch of code below and paste it into the module window that opens.
4) Use View to open the Project Explorer. Open folders until you see Sheet1. Double click on the icon and a code module should open. Paste the second piece of code into that window.
5) Save the workbook from the File menu.
6) From the File menu, "Close and Return to Microsoft Excel".
Place this code in a new normal code module:
In the code module for Sheet1:
Select cell B141 and a ListBox will appear.
The list will be those entries in C1:C140 that have a matching "y" in column B. Select any number of entries on that list and the sum (taken from column D) of the selected entries will be put in D141. Either pressing Done or using the mouse to select some other cell will dismiss the list, leaving the sum in D141. Pressing Cancel will dismiss the list and return D141 to the value when the list first appeared.
The list appears with nothing selected. With up to 140 entries, that could be a bother. I would like to have the list appear with the same items selected as the last time, but the probablity that one list will have different members than the last has me stymied for the moment.
Bookmarks