Getting the order of the selected ListBox items in VBA?
<p>I have two list boxes, one on the left and once on the right. Ideally, I want the user to be able to select whatever data he wants from the left list box, and press the "Add" button for the items he selected to be displayed in the second list box <strong>in the order they choose the item</strong>.</p>

<p>If they select item 2 first, then item 23 second, and item 17 third, I want the listbox on the right to display:</p>

<pre><code>Item 2
Item 23
Item 17
</code></pre>

<p>Now while I can get the user to click on Item 2, then Add (in which the compiler loops through the list items and puts the selected one in the second list), then item 23, then Add, and so on, I want to automate the process a little more. I know the "Selected" property of a listbox is an array of booleans.</p>

<p>I came across <a href="https://stackoverflow.com/questions/11263823/how-do-i-get-the-selected-items-from-a-multi-select-listbox-in-order-that-they-w">this</a>, but its in jQuery, and I don't know the first thing about it:</p>

<p>Thoughts? Is there some way by which I can get the compiler to remember the order of selection?</p>