+ Reply to Thread
Results 1 to 14 of 14

How to adapt this listbox code when multiselect is enabled?

  1. #1
    Registered User
    Join Date
    11-24-2011
    Location
    Home
    MS-Off Ver
    Excel 2007
    Posts
    20

    Question How to adapt this listbox code when multiselect is enabled?

    Hi,

    I would like to adapt 2 codes that are working perfectly with a listbox with multiselect disabled. Not sure how to do so, so I'm asking you

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

    Thanks in advance.

    http://www.mrexcel.com/forum/showthr...84#post2950084
    Last edited by Kimberley; 12-02-2011 at 08:49 AM.

  2. #2
    Registered User
    Join Date
    11-24-2011
    Location
    Home
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: How to adapt this listbox code when multiselect is enabled?

    It doesn't inspire you much, does it?

  3. #3
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: How to adapt this listbox code when multiselect is enabled?

    Yes , but dont be in a rush. Off for a walk then work.. we are all voluntary
    Last edited by pike; 12-01-2011 at 02:13 AM.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: How to adapt this listbox code when multiselect is enabled?

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-24-2011
    Location
    Home
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: How to adapt this listbox code when multiselect is enabled?

    Hi thanks, I can't get the code to work (it does nothing)

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: How to adapt this listbox code when multiselect is enabled?

    can you attach your workbook ?

  7. #7
    Registered User
    Join Date
    11-24-2011
    Location
    Home
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: How to adapt this listbox code when multiselect is enabled?

    I attached it in the 1st post, let me know if it doesn't show up.

  8. #8
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: How to adapt this listbox code when multiselect is enabled?

    Hi There is no listbox in the example?

  9. #9
    Registered User
    Join Date
    11-24-2011
    Location
    Home
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: How to adapt this listbox code when multiselect is enabled?

    Sorry I got mixed up with my files, thanks for pointing this out. Here is the right one.
    Attached Files Attached Files

  10. #10
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: How to adapt this listbox code when multiselect is enabled?

    Hi Kimberley

    no easy way with multi column listboxes you have to use an array

    Please Login or Register  to view this content.
    Last edited by pike; 12-02-2011 at 07:50 AM. Reason: added this bit Not ListBox1.Selected(i)

  11. #11
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,289

    Re: How to adapt this listbox code when multiselect is enabled?

    I'm afraid your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    Remember what the dormouse said
    Feed your head

  12. #12
    Registered User
    Join Date
    11-24-2011
    Location
    Home
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: How to adapt this listbox code when multiselect is enabled?

    I added the link in the 1st post.

    Thanks pike for the code, Norie on mrexcel is helping me with the Up/Down buttons.

    When I delete items using your code, I'm still being able to select the deleted entries as you can see on this screenshot:

    http://img507.imageshack.us/img507/9150/65383308.png

    Also, since I deleted 5 items (item #8 to #12), is it possible to update the number column so 13 is becoming 8, 14->9, 15->10 [...] 19->14?

  13. #13
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: How to adapt this listbox code when multiselect is enabled?

    Try ....
    Please Login or Register  to view this content.
    should remove the blank lines

  14. #14
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: How to adapt this listbox code when multiselect is enabled?

    or correctly
    Please Login or Register  to view this content.

+ 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