+ Reply to Thread
Results 1 to 6 of 6

Return row index of selected items in multicolumn multiselect listbox

  1. #1
    Registered User
    Join Date
    06-10-2014
    Posts
    15

    Return row index of selected items in multicolumn multiselect listbox

    I have a listbox with 8 columns. Multiselect is enabled, and it must stay this way. As part of my program, after the user presses a command button, I need to use the row indexes of the selected rows in order to copy the selected information into an array which is then placed in a different listbox, and then delete the items from the original list. Pseudocode of what I want to do:

    Please Login or Register  to view this content.
    But my understanding is that .ListIndex does not work this way with multiselect listboxes. I've tried searching for a solution for a while, but I cannot find one. Is there any way to accomplish what I want to here?
    Last edited by CaptainK; 06-30-2014 at 04:10 PM. Reason: made title more specific. also, how do I make codebox bigger???

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Return row index of selected items in multicolumn multiselect listbox

    Hi,

    I have built a miniature working example of what I think you're asking for.

    Let me know if it helps
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Return row index of selected items in multicolumn multiselect listbox

    Sorry I didn't read your post properly...I have missed the "multiple columns" part. Let me have another go and get back to you

  4. #4
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Return row index of selected items in multicolumn multiselect listbox

    Try this version instead...
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-10-2014
    Posts
    15

    Re: Return row index of selected items in multicolumn multiselect listbox

    Holy cow, that works great! Not only is it much much (much) simpler than what I was going for, it runs a little bit faster (by a split second, but the difference is noticable). Thanks so much!

  6. #6
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Return row index of selected items in multicolumn multiselect listbox

    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)

Similar Threads

  1. Copy Selected items from multicolumn, multiselect listbox to another listbox
    By Willigb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-19-2013, 11:27 AM
  2. how do I return a HIGHLIGHTED (not selected) item from a ListBox?
    By michaeljoeyeager in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 08:27 AM
  3. [SOLVED] Copy one listbox item to same index position in another listbox
    By Foreverlearning in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-19-2012, 06:05 AM
  4. How to Return Selected in MultiColumn MultiSelect Listbox?
    By kirsty in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2011, 07:23 PM
  5. Doubleclick in a multicolumn listbox and get the column index?
    By peter233 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-15-2008, 06:31 AM

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