You are here:

Excel/Default Value in a drop down


Hi Tom,

I have a question about vba. Hope you can help with.

I created a drop down list "Model" using vba. The values in the drop down are "All", "Model1", "Model2", "Model3", "Model4", and "Model5". It looks like this:

Value in Cell A1: Model (This is the column header)
Value in Cell A2: Blank. But once the cell is clicked, it will pop up a drop down menu that has all the listed values (All, Model1, Model2, etc.).

I want to display "All" as my default value in Cell A2 if I don't click on cell A2. Is there a way to do that?

This is the macro that I have for the drop down.

Dim myList$

myList = ""
myList = "All, Model1, Model2, Model3, Model4, Model5"
myList = Mid(myList, 1, Len(myList))

Thanks in advance for your help,



Dim myList$

myList = ""
myList = "All, Model1, Model2, Model3, Model4, Model5"
myList = Mid(myList, 1, Len(myList))

just assigns the string you show to the variable mylist.  So when yo usay htis is the macro you have for the dropdown, I am not sure what that means.  I assume that is part of the code you use to put data validation (list option) in cell A2 and assign that string to be the list in the dropdown.  

So assuming you are using data validation to produce your dropdown, and you are adding that data validation using code, then just add the line

Range("A1").Value = "All"

in you code.  The data validation list option just puts the selected value in the cell.  So to get that same result, you just assign the value to the cell.  This can be done before or after you apply the data validation because the data validation only controls entries made by the user - not entries made by code.

Tom Ogilvy  
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Tom Ogilvy


Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]


Extensive experience.

Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2016 All rights reserved.