How to Display Named Cell Ranges Based on an Excel Drop-Down List
Question details
Dynamically display differently formatted templates from named ranges depending on the selection made in a drop-down list.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Creating an interactive dashboard to display specific employee-review templates that vary in size, format, and worksheet location based on a user's drop-down choice.
- Observed behavior
- Standard formulas can retrieve matching data values but fail to preserve the varying dimensions, worksheet locations, and complete formatting of the original templates.
Ensure your template ranges are already defined via the Name Manager and note that to perfectly replicate formatting, you will need to save your file as a Macro-Enabled Workbook (.xlsm).
Use a VBA Macro to Copy the Named Range and Formatting
Since standard Excel formulas cannot transfer cell formatting or handle varying dimensions easily, a VBA macro is the most effective approach to dynamically copy both the values and the layout of your templates.
A VBA script can detect when a user changes the drop-down list selection. Once triggered, the script clears the previous template area, locates the corresponding named range from your source sheet, and performs a copy-paste operation that includes all cell formats, column widths, and background colors.
Press Alt + F11 on your keyboard to launch the Microsoft Visual Basic for Applications (VBA) window.
In the Project Explorer on the left, double-click the specific worksheet that contains your drop-down list (e.g., Sheet1 - Dashboard).
Select 'Worksheet' from the left drop-down above the code window and 'Change' from the right drop-down. Write a script that uses the Target.Value to define the Range to copy, and use PasteSpecial xlPasteFormats along with xlPasteValues to paste it into your destination area.
Close the VBA editor and change the selection in your Excel drop-down list. The macro will automatically run and display the fully formatted template.

Use the FILTER Formula (For Values Only)
If you only need the raw data values from the selected template and do not care about the visual formatting, you can use Excel's dynamic array formulas like FILTER.
Seamlessly Manage Drop-Downs and Macros in WPS Spreadsheet
WPS Spreadsheet provides powerful data validation, full support for dynamic array formulas, and seamless VBA compatibility, making it incredibly simple to build interactive dashboards and switch between formatted templates.
- 1. Create Your Drop-Down List: Navigate to the Data tab, select Data Validation, and choose 'List' to reference your template names.
- 2. Enable the Developer Tab: Go to Menu > Options > Customize Ribbon and check 'Developer' to access the macro environment.
- 3. Implement the Macro: Open the VBA editor within WPS Spreadsheet and paste your Worksheet_Change code to copy and paste formatted named ranges dynamically.

Frequently Asked Questions
Why do Excel formulas fail to copy cell background colors and borders?
Excel formulas, including dynamic array functions like FILTER or lookup functions, are designed strictly to calculate and return data values. They do not interact with or extract the graphical layer of the cell, such as background colors, borders, or font weights.
Can I use the INDIRECT function to display formatted named ranges?
While the INDIRECT function is excellent for dynamically pointing to a named range based on text in a drop-down list, it still functions as a standard formula. It will return the values contained within the named range but will ignore the source formatting.
How do I create a named range for my templates?
Highlight the cells containing your specific employee-review template. Click inside the Name Box located to the left of the formula bar, type a unique name (without any spaces), and press Enter.
Is it possible to display varying template sizes without VBA?
Yes, but only as a static picture. You can use the 'Linked Picture' feature combined with a dynamic named range (using INDEX or INDIRECT). This will display an image of the formatted cells that updates dynamically, though you will not be able to edit the data directly from the dashboard.




