Excel/Excel Macro/VBA to reset menu choices in a dynamic drop-down box created using data validation
I have created a dynamic dependent drop down list in excel. The first selection box determines what will be displayed in the second selection box. I have used the data validation, INDEX, MATCH & OFFSET functions to create the drop down boxes & associated menu choices. I would like to know how to reset the menu choices in both selection boxes to the first item in each list, namely 'Please select an item'.
I assume you are using data validation to create your dropdown boxes.
Your dropdown boxes only provide restrictions for manual entry. In code you would just do
Range("A1").Value = "Please select an item"
Range("B1").Value = "Please select an item"
(assuming the dropdowns are in cells A1 and B1)
You should put in the exact text that is the first entry in your dropdown list but this is not essential for it to work in your first drodown. In your second, if you build the dynamic list even considering this first value in the first dropdown then it would be useful to exactly match what is the first entry of the first dropdown box with the cell value.
Just to be clear, your code can put any value in either cell where the dropdown box is located because data validation does not restrict what vba code can do.
Hopefully that is what you are asking me.
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