+ Reply to Thread
Results 1 to 2 of 2

selecting multiple listbox items based on test in range

  1. #1
    Forum Contributor
    Join Date
    10-17-2008
    Location
    Vancouver
    MS-Off Ver
    2002 and XP
    Posts
    117

    selecting multiple listbox items based on test in range

    Hello, have a multiselect listbox in a user form populated from a database,

    trying to have a default selection list on a worksheet range.

    trying to make it so that for each item in the default selection range, will have it's equivalent selected on the listbox.

    This because there are many option to select on the listbox and have a button-activated 'default' selection would be awesome.

    Here it the code I am currently trying

    Please Login or Register  to view this content.

    Any tips?

  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: selecting multiple listbox items based on test in range

    Hello kuraitori,

    This macro uses the Dictionary object to hold the ListBox entries and their respective ListIndex values. This makes selecting the defaults much easier because the Dictionary has a method (Exists) that allows you to check if an element in the array exists without looping through each element in the array.
    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!)

+ 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