How to Create a Listbox in VB From an Excel Spreadsheet

A list box is a visual interface component that contains a list of predetermined options. List boxes save time by eliminating repetitive typing and reduce input errors by requiring workers to select from the list. For example, instead of one worker entering "firetruck" and another entering "fire truck," the list box offers both workers the same choice, so the input will be identical. List boxes can be created through Excel's menu or through VB code.


Open the Excel workbook in which you want to create a list box.


Press "Alt-F11" to bring up Excel's Visual Basic Editor.


Click "Insert," then click "Module" to create a blank code module page.


Type the following code into the blank code module:

Sub createListBox()

ActiveSheet.ListBoxes.Add(0, 0, 50, 50).Select

End Sub


Close the VB Editor window.


Press "Alt-F8" while on the workbook to bring up the Macro window. Select "createListBox" and click "Run."