How to Automatically Set a Data Validation Drop-Down Value in Excel
Question details
The user needs to automatically update or populate a cell containing a data validation drop-down list based on the value selected or entered in another cell.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Building dynamic forms or tracking dashboards where dependent drop-down selections should auto-populate based on preceding user inputs to save time.
- Observed behavior
- Standard data validation restricts user input to a predefined list but cannot automatically change the cell's current value. The drop-down cell remains static until manually changed by the user.
Ensure you are using the desktop version of Excel, as VBA macros are required to dynamically change cell values and are not supported in the web version.
Use a VBA Worksheet Change Event to Auto-Populate the Cell
Since standard data validation cannot calculate or push a new value into a cell, using a VBA macro is the only way to detect a trigger and automatically update the drop-down cell.
VBA allows you to dynamically change the actual value of a cell containing a data validation list without overwriting the validation rule itself. Keep in mind that users opening the file will need to enable macros for this automation to work.
Right-click the sheet tab at the bottom of your Excel window and select 'View Code' to open the Visual Basic for Applications editor.
In the code window, paste a Worksheet_Change event script. Configure it to check if your trigger cell (e.g., A1) was modified, and if true, set the value of the drop-down cell (e.g., B1).
Close the VBA editor. Go to File > Save As and save your file as an Excel Macro-Enabled Workbook (*.xlsm) so the code runs in future sessions.

Use a VLOOKUP Formula as an Alternative
If you want to avoid using VBA macros, use a lookup formula in a separate adjacent cell to display the desired value based on the first cell's input.
Use WPS Spreadsheet to Manage Data Validation and VBA Macros
WPS Office offers a powerful, free alternative for spreadsheet management. WPS Spreadsheet fully supports data validation, complex formulas like VLOOKUP, and VBA macros, allowing you to automate drop-down lists effortlessly.
- 1. Download and Install: Get WPS Office from the official website and open your Excel workbook in WPS Spreadsheet.
- 2. Enable Macros: Go to the Developer tab to easily access the VBA Editor and enable macros for your automated drop-downs.
- 3. Apply Data Validation: Navigate to the Data tab and click 'Validation' to set up your drop-down lists seamlessly.

Frequently Asked Questions
Can I use an IF formula directly inside the data validation source to change the cell value?
No. A formula placed inside the Data Validation 'Source' box only determines the list of options available in the drop-down. It cannot calculate or force a specific value to be selected in the cell itself. You must use VBA to change the cell's actual displayed value.
Why doesn't my VBA macro trigger when I change the cell?
Ensure that macros are enabled in your Trust Center settings. Additionally, verify that your VBA code is placed in the specific Worksheet module (e.g., Sheet1) rather than a standard module, and that it utilizes the Worksheet_Change event correctly.
Does the VBA method work on Excel for the Web?
No, the VBA solution will not work in Excel for the Web because the web version does not support macros. If you need a web-compatible solution, you must use the formula alternative (like VLOOKUP) in a separate cell instead of modifying the drop-down cell itself.




