+ Reply to Thread
Results 1 to 6 of 6

Doubleclick an item in listbox (userform)

  1. #1
    Registered User
    Join Date
    05-16-2011
    Location
    montreal
    MS-Off Ver
    Excel 2003
    Posts
    19

    Doubleclick an item in listbox (userform)

    Hi,

    In my userform, I have a search button that gives me search results in a listbox1.
    After I have the results, is there a way to double-click on one item and to open listbox2 where I can read the full continent of the item (CELL) and to close the listbox2 &return to my previous results.

    I joined a test userform that can help to understand.
    Last edited by Ray316; 07-21-2011 at 03:31 PM.

  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,258

    Re: Doubleclick an item in listbox (userform)

    Hello Ray316,

    I added a third column to ListBox1 that holds the sheet name and address. This string gets passed to UserForm2 which display the full text in a TextBox. The attached file has all the changes made to it.
    Attached Files Attached Files
    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
    05-16-2011
    Location
    montreal
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Doubleclick an item in listbox (userform)

    Hi Ross,

    I tried it, and it works, as long I do search before. But if there is no results, and the user doubleclick the listbox1 there is error message by VBA.
    How can I solve that?

  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,258

    Re: Doubleclick an item in listbox (userform)

    hello Ray316,

    Copy and replace the event code for ListBox1 with the code below.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-16-2011
    Location
    montreal
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Doubleclick an item in listbox (userform)

    Hi Lieth Ross,

    Thank you very much for your help.
    It works perfectly.

    A++++++

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

    Re: Doubleclick an item in listbox (userform)

    Hello Ray316,

    You're welcome.

+ 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