Hi all. I am continually amazed at the wealth of knowledge represented here, and my Excel/VBA skills have been helped immensely nearly every time I come here for help. So, thanks in advance to all the gurus that may help with this question. I feel like it's a pretty simple one, but I'm just not familiar with the right approach and I'm afraid of going too far down one path only to find I should have taken another.
I have built a series of subroutines that create a list of potential customers from a network listing of directories. Some of the directories are customer names, and some are not. I'd like the user to see a list of all the directories and put check marks next to the ones they want to flag as customer names. As I said, I already have the data as values in column A, from A1 to A#, with #=number of potential names. I've added a userform into the project, and added a listbox and commandbutton with the following super simple code:
This works just fine for making a list, but there are no checkboxes, obviously. VBAhelp says that listboxes can have checkmarks, but I'm not finding the relevant info in the helpfile.![]()
Private Sub CommandButton1_Click() ListBox1.RowSource = "=Sheet1!A1:A5" End Sub Private Sub ListBox1_Click() End Sub
My ultimate goal is to have the userform present a list of all the data in Column A as individual lines in a listbox with spots for checkmarks next to each line. The user would select or de-select the lines based on whether they were desired customer names, and click an "OK" button which would make a new column of data containing just the names the user wanted.
Simple, yes? I think so, but, like I said, I can't seem to find any VBAhelp about the checkbox stuff, and so I can't proceed from there. My userform knowledge is practically nil, so I'm afraid I'm in over my head at this point. Any and all advice is appreciated!
UPDATE:
Sorry to "reply" to my own post, but I think I've uncovered some more info, and want to see if anyone agrees that I'm on the right track. By setting the MultiSelect property to 1-fmMultiSelectMulti, and the ListStyle property to 1-fmListStyleOption, I've got data with checkmarks that can be selected or de-selected individually! This goes a long way toward solving my problem, I believe.
Still, I need to figure out how to check the status of each checkbox and create a new column of data for only those entries selected.
Bookmarks