+ Reply to Thread
Results 1 to 9 of 9

List Box Selections Outputting Multiple Selections with One Click

  1. #1
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    List Box Selections Outputting Multiple Selections with One Click

    Hi all,

    I have something weird happening to some list boxes located within a form made in the VBE. I have 4 list boxes in total and when I select a value from them, I will have to double click the value just ot highlight it. Also, if I select the 3rd from the top (in two list boxes), multiple selections will be made. The form in question is called frmTool2.
    Attached Files Attached Files
    Last edited by Mordred; 07-21-2011 at 12:28 PM.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  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: List Box Selections Outputting Multiple Selections with One Click

    Hello Mordred,

    I can not run the workbook on my system but I did look at the code. I notice you have a reference set to a RefEdit control. While these controls work well in applications, they are not very reliable when used on VBA UserForms. I would remove the control from your project, modify the code to work around its absence, and try it again.
    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
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: List Box Selections Outputting Multiple Selections with One Click

    Hi Leith,

    Thanks for that. I don't see a reference to RefEdit anywhere within my code but I am looking.

  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: List Box Selections Outputting Multiple Selections with One Click

    Hello Mordred,

    It was listed in the VBA references as missing in my workbook. Open the VBIDE , go to Tools > References... and check the list. If it is there then it will have a check mark next to it. If not, it will say MISSING:

  5. #5
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: List Box Selections Outputting Multiple Selections with One Click

    Thanks Leith, I deselected it and hit ok so now it isn't being referred to. However, 2 of the 4 listboxes still double select from one selection. Mayhap this is an issue that regards Excel controls.

  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: List Box Selections Outputting Multiple Selections with One Click

    Hello Mordred,

    Perhaps it is since the code has no references to worksheet events nor UserForm events which might cause that behaviour. It could also be the workbook is partially corrupted. Have you tried creating a new workbook and copying the code into it to see if it behaves the same?

  7. #7
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: List Box Selections Outputting Multiple Selections with One Click

    Maybe I'll recreate the workbook and start again, thanks Leith for the advice!

  8. #8
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    1,252

    Re: List Box Selections Outputting Multiple Selections with One Click

    Hi Mordred,

    If you wrap the listboxes with Frame controls rather than with Label controls, the problem disappears. The "look" is exactly the same.
    Attached Files Attached Files
    Hope that helps,

    Colin

    RAD Excel Blog

  9. #9
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: List Box Selections Outputting Multiple Selections with One Click

    So I remade my workbook and used frames like Colin suggested and all is good in my hood! Thanks all for your insight!

+ 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