Excel VBATutorial                       Tutorial on Excel macros

 

Excel VBA Macros

Excel Macros Table of Contents

Excel Visual Basic Editor

Excel Macros Vocabulary

Excel Userforms

Excel Consulting

Excel Tutorial on Macros

Email to excel-vba.com

Here is a sample of what you will find in lesson 29 of the downloadable Tutorial on Excel macros

Lesson 29 on Excel macros (VBA):

Combo Boxes in VBA for Excel

Before we begin on the Combo Box

The difference between a combo box and a list box is that the combo box is a drop-down list and the user can submit a single value from the drop-down list. The list box shows a certain number of values with or without a scroll bar and the user can select one or more values.

Combo Box
VBA for Excel combo boxes

List Box
VBA for Excel list boxes


If you are looking for a drop-down list (also called pull-down lists) to use on a regular worksheet see the much easier and user friendly Excel drop-down lists in the website on Excel.

When you double click on the combo box in the Visual Basic Editor you will see all its  properties in the Properties  window .

No programming is needed to submit the  list of values that will be offered to the user within the combo box. Look for the RowSource property.

The RowSource Property:

The values that should appear in the drop-down list of the combo box are submitted in the RowSource property. For example, if the value of the RowSource property is Balance!A1:A12 The values residing in cell A1 to A12 of the sheet named Balance will be offered as choices to the user who clicks on the small arrow of the combo box.

The rules to submit the RowSource property is the name  of the sheet where the list resides followed by an exclamation point (!), the address of the first cell, a colon and the address of the last cell.

IMPORTANT NOTE: if there is a space or a special character within the name of the sheet where the list resides you must surround the name of the sheet with simple quotes. For example: 'New Balance'!A1:A12.


We hope you have enjoyed this introduction to lesson 29
for more on this topic and a complete course on Excel macros download the
Tutorial on Excel Macros


Next Lesson: List Boxes in VBA for Excel

 

Excel Tutorial on Macros

Excel VBA Macros

Excel Macros Table of Contents

Excel Visual Basic Editor

Excel Macros Vocabulary

Excel Userforms

Excel Consulting