Move Excel Listbox Items

To select specific items from a long list, you can create 2 ListBoxes on a worksheet.

Then, use arrow buttons to move all the items from one list to the other, or move selected items only.

ListBoxes on Worksheet

In the screen shot below, there are 2 ListBoxes, and 4 buttons with arrows, on a worksheet named CreateRpt.

  • In the ListBox at the left, you can select one or more items that you’d like in a report.
  • Then, click the 2nd button, with one arrow that point to the right.
  • The selected items will move to the ListBox on the right.

OR

  • You could click the. top button, to move all the items to the right-hand ListBox.
Two ListBoxes and Buttons on Worksheet
Two ListBoxes and Buttons on Worksheet

Items List on Worksheet

When you get started, the list at the left is filled with items. Those items come from a named range, on a worksheet named Admin.

You could modify that list, to include the items that you need in your ListBox.

Item list in named range on Admin worksheet
Item list in named range on Admin worksheet

Use the ListBoxes

In the sample file that you can download, there is a Menu worksheet, with a navigation button, “Select Report Items”.

Click that button to go to the CreateRpt worksheet, where the ListBoxes are located.

Navigation button on Menu sheet
Navigation button on Menu sheet

Macro Runs Automatically

When the CreateRpt sheet is activated, an event procedure (macro) runs automatically.

The VBA code in that event procedure does the following steps:

  • Clears both ListBoxes
  • Adds all items from worksheet list, in ListBox at the left

Back to Menu Sheet

On the CreateRpt sheet, there is another navigation button, “Menu”, at the top left of the sheet.

Click that button, and a macro runs, to take you back to the Menu sheet.

Navigation Button Macros

The two navigation buttons run simple macros, and the VBA code is shown below.

First, here is the code that the Menu button runs:

Sub GoMenu()
Worksheets("Menu").Activate
End Sub

Next, here is the code that the Select Report Items button runs:

Sub GoRpt()
Worksheets("CreateRpt").Activate
End Sub

Read the Detailed Instructions

Thanks to Dave Peterson, who sent me the instructions and sample code for moving listbox items.

To see the details on how this technique works, visit the Excel VBA Move Listbox Items page on the Contextures website.

The tutorial shows, step by step,  how to set up the worksheets, add the ListBoxes, and create the named ranges.

It also shows all of Dave’s sample code, for moving the items between the ListBoxes.

Download the Move Listbox Items Sample File

To see the code, and test the Listbox move items code, you can download the Listbox Move Items sample workbook.

The file is in Excel 2007 format, and is zipped. It contains macros, so enable them if you want to test the code.

Video: Move Listbox Items on Worksheet

To see the steps to create the Listbox example, you can watch this Excel video tutorial.

______________

3 thoughts on “Move Excel Listbox Items”

  1. Can you explain to me what the Me. means in the “Excel VBA Move ListBox Items on UserForm” code example posted on your website? I’m a new programmer and usually use ‘ ThisWorkbook.Sheets(“Sheet1”) ‘. Is this a different way of expressing that line or is completely different altogether.
    I used the YouTube tutorial (listboxes on a worksheet) and the directions explain on the website; however, I cannot get the listboxes to populate. I even tried making a UserForm, but always opens the Debug window.
    Any ideas what I am doing wrong. I copied your code character by character, cut/paste, and then eyeballed it several times to see if I made an error. None of those methods are working.
    Greg

  2. Wow, I didnt know I could do that. But now I need to transfer the listbox items I just between the two LB’s to cells on another sheet. I’ll Explain. I Have The two listboxes (ListBoxEast ListBoxWest) The Named Range for the list box is SchoolsList, and I removed the MoveAll buttons, leaving only the move selected L/R (BTN_moveSelectedEast & BTN_moveSeletedWest). When the file opens, the ListBoxEast populates with the Named Range (SchoolsList) which is a list of schools that need to be sorted by region (east west). Once sorted (and here’s where I’m having difficulty)I need to have the items now in the East & West boxes transferred and saved to a preset range of cells for each designation that my formulas can draw from with the click of a button…..but I cannot extract the data.I’ve tried all that I know (which is limited),and I’m not admitting defeat, but my head hurts from all the banging against the wall… That sheet is named LISTS, and the cell ranges are EAST(A3:A32) & WEST (A34:A63).I Also dont want the selections to clear (or reset) automatically once sent to the formula sheet, rather have that option and opt for it by use of a command button. It is not for building a data base, but sorting criteria of student athletes which are grouped and than looked up by School. I appreciate any help that can be given.
    Thank you,
    Mike

Leave a Reply to Anonymous Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.