+ Reply to Thread
Results 1 to 1 of 1

Checkbox or listbox?

  1. #1
    Registered User
    Join Date
    02-27-2008
    Location
    Irving, Texas
    MS-Off Ver
    MS Office 2016
    Posts
    96

    Checkbox or listbox?

    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:

    Please Login or Register  to view this content.
    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.

    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.
    Last edited by ahartman; 04-07-2008 at 01:10 PM.
    -Adam Hartman
    Mechanical Engineer

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1