

Once done you should be able to see the items in the user form. AddItem method adds items to the combo box. In Excel event is like an action – clicking house, pressing enter button etc so when the form is loaded, the above code adds items to the combo box. We need to initialize the user form and element or items to the dropdown of the combo. Adding Code to Combo box:įirst, we select the combo box and double click it to insert the code. We insert this code by selecting and double clicking them with mouse. The next step is to insert the vba codes to the three items in the form to make then operational. The final layout of your User form should look like following: Similarly selection buttons and adds two to the form.Select Combo box and draw one in the form.Make From Toolbars visible from View > Toolbox.Change the caption of the form by going to Project Properties > Caption> enter Supplier Name List.Go to Insert>User Form and insert a user form. As a first step, select This workbook (for our example sheet named 06 – Using VBA to create ….) Inserting a User form: Now the VBA section can be reached by either pressing Alt+F11 or by Right Click the Sheet Tab>Select View Code. Either way will lead you to the VBA Window. Otherwise, when you will press save, it will ask you to save it in this format. In order to access the VBA section of your work sheet – first save it as macro enabled worksheet to make sure that what ever you do, it can be saved in appropriate format worksheet. There could be several suppliers with similar names, so we want a list that suggest me the available options.

Let’s assume a list of suppliers that you have – it could be any list but just for the sake of example we are using a list of suppliers to produce invoices. In today’s post we will learn how to do it with VBA Features. If it has been present to some extent, the ability to complete the text more dynamically is not present. Though this is realistic and practical option it lacks one feature that I really need – auto completion.

One of the methods to do this is to use Dropdown menu from the Data Validation Option under Data Tab. We use them to choose amongst the already selected choices and to avoid repetitive typing. Lists are one the commonly used features of Excel.
