+ Reply to Thread
Results 1 to 5 of 5

Listbox with checkboxes

  1. #1
    Registered User
    Join Date
    02-24-2008
    Location
    Tonbridge/Brighton, England
    MS-Off Ver
    2007
    Posts
    29

    Listbox with checkboxes

    Is it possible to insert the control that is the listbox with a checkbox against each item into a userform that is the one that allows which controls are embedded into the toolbox, and if so, what the name of the control is?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Listbox with checkboxes

    Hello timbim,

    Set the ListBox.ListStyle = 1 and the ListBox.MultiSelect = 1. This will place Check Boxes beside each item. It will be up to you to determine which ones have been checked. For will have to loop through the items and check the Selected property for each item.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    02-24-2008
    Location
    Tonbridge/Brighton, England
    MS-Off Ver
    2007
    Posts
    29

    Re: Listbox with checkboxes

    Many thanks, one other query, how do you invoke a userform from a button on another form or a shape?

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Listbox with checkboxes

    Hello timbim,

    To call the UserForm from a Command Button or Shape, attach a macro that displays the form. Place the macro code in a VBA module.
    Please Login or Register  to view this content.
    Change the name UserForm1 to the name of the UserForm you want to display.

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Listbox with checkboxes

    You could set the ListStyle of the Listbox in it's Properties to fmListStyleOption, or with code
    Please Login or Register  to view this content.
    Last edited by Andy Pope; 06-03-2009 at 05:28 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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