+ Reply to Thread
Results 1 to 5 of 5

Userform ListBox that recalls prior selections made

  1. #1
    Forum Contributor
    Join Date
    05-24-2006
    Location
    Los Angeles
    MS-Off Ver
    2019
    Posts
    328

    Userform ListBox that recalls prior selections made

    Hi,

    Is it possible to have a Userform containing a multi select ListBox open with the same items selected/highlighted from the last time the UserForm was opened and ListBox selections made?

    I have a ListBox on a UserForm that reads from a dynamic range and outputs to a dynamic range and I would like the ListBox to be repopulated with the selections made the last time the UserForm was opened.

    Lawrence
    Last edited by skysurfer; 08-08-2010 at 02:54 PM.

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

    Re: Userform ListBox that recalls prior selections made

    The Userform will retain the selections if you Hide it as opposed to Close it.

    If you want to retain the selections for another session then you must save the selections to a hidden sheet, the registry, ini file or text file. Then read the selections back into the Userform when it is loaded again
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    05-24-2006
    Location
    Los Angeles
    MS-Off Ver
    2019
    Posts
    328

    Re: Userform ListBox that recalls prior selections made

    royUK,

    If I have the selection stored in Range("selectedstuff") on Sheet11, what is the code to have the list box read that range as the highlighted selections when the file and form are reopened?

    Thanks!

    Lawrence

  4. #4
    Forum Contributor
    Join Date
    05-24-2006
    Location
    Los Angeles
    MS-Off Ver
    2019
    Posts
    328

    Re: Userform ListBox that recalls prior selections made

    Just bumping this up the list...

    :-)

  5. #5
    Forum Contributor
    Join Date
    05-24-2006
    Location
    Los Angeles
    MS-Off Ver
    2019
    Posts
    328

    Re: Userform ListBox that recalls prior selections made

    Thanks to Leith Ross (and two days of searching the forum to locate his elegant solution), here it is:


    Please Login or Register  to view this content.
    And Leith's original post is here: http://tinyurl.com/22ozfzr

    THANKS LEITH!

    Lawrence

+ 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