Caroline_678
06-21-2017, 11:01 AM
Hi! Hopefully someone can help me out here.
I have a userform that someone can type in a name to add to a list and click a command button and it adds it to another sheet in the document. On the same userform there is a listbox that is filled by using the rowsource method that refers to the specific sheet cells A2:A20. This all works great, you type the name in, click the command button that says "add" and it populates into the listbox and onto the sheet. However I am wanting to program another command button that will essentially remove an item from the list if it selected in the listbox. But it's not as easy as just removing the item because the list is not populated in the code, it's populated by the sheet that it references.
Maybe this doesn't make sense? I'm trying to explain it in a way that makes sense but this is more difficult than I thought! If you have any questions I will try to answer them as best I can. I'm pretty new to VBA, I can make very basic userforms and this is the first time I'm trying to something more than just adding something to a list.
Thanks in advance for any of the help I get!
I have a userform that someone can type in a name to add to a list and click a command button and it adds it to another sheet in the document. On the same userform there is a listbox that is filled by using the rowsource method that refers to the specific sheet cells A2:A20. This all works great, you type the name in, click the command button that says "add" and it populates into the listbox and onto the sheet. However I am wanting to program another command button that will essentially remove an item from the list if it selected in the listbox. But it's not as easy as just removing the item because the list is not populated in the code, it's populated by the sheet that it references.
Maybe this doesn't make sense? I'm trying to explain it in a way that makes sense but this is more difficult than I thought! If you have any questions I will try to answer them as best I can. I'm pretty new to VBA, I can make very basic userforms and this is the first time I'm trying to something more than just adding something to a list.
Thanks in advance for any of the help I get!