Results 1 to 4 of 4

Thread: userform order

  1. #1

    userform order



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Is there a way to have the names listed in a userform placed in the order in which they are chosen in the userform? For example, I have 10 names of people listed in a userform. I want the user to check the 5 or 6 names chosen and place them in the order that they were checked.

  2. #2
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,225
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    The only way I can think of that you could do this is to set up a checkbox for each item, then code the CheckBox#_Click events for them, trying to track the order. You'd end up having to fight the logic through as to when they reset, so it may be kind of awkward.
    Ken Puls, FCPA, FCMA, MS MVP (Excel)

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training) or with my book M is for Data Monkey!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  3. #3
    You could always use the Listbox Click event to add each selection to an array and then use that.

  4. #4
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,225
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    You still have to worry about what point the array gets reset though, right? What I mean is that: the user click 2, 3, 4, then realizes they screwed up and wanted 5, 2, 3. How do you deal with that. I guess you could have a reset button on the form...
    Ken Puls, FCPA, FCMA, MS MVP (Excel)

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training) or with my book M is for Data Monkey!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •