VBA & Macro Problems

Reset Excel Data Validation Cells When a Workbook Opens with VBA

Steven ParkerSteven Parker Nov 12, 2026 869 views

Question details

The user needs to reset a range of Excel data-validation cells to a default prompt each time the workbook opens.

Reset Excel Data Validation Cells When a Workbook Opens with VBA
Product
Microsoft Excel VBA
Device & OS
not provided
Scenario
A workbook uses data-validation cells, and the user wants those cells cleared or reset to a standard prompt automatically when the file opens.
Observed behavior
The data-validation cells retain their previous values until a macro resets them during the Workbook_Open event.
Before you start

Test the event procedure on a backup copy and confirm the worksheet name and target range, such as Sheet1 and G2:G100. Save the file as an XLSM workbook so the VBA code can be retained, and make sure macros are enabled for testing.

Solution 1Recommended

Use the Workbook_Open event to reset the validation range

Use this solution when the cells should return to the same default prompt every time the workbook opens.

The Workbook_Open event runs automatically after the workbook opens. Place the procedure in the ThisWorkbook module rather than in a standard module, and update the worksheet and range references to match your file.

1
Open the VBA editor

Open the workbook in Excel, press Alt+F11, and locate the workbook under the Project pane.

2
Open the ThisWorkbook module

Double-click ThisWorkbook under Microsoft Excel Objects, then paste the Workbook_Open procedure into the code window.

3
Add the reset code

Enter this code and change the worksheet name or range as needed: Private Sub Workbook_Open() Application.ScreenUpdating = False Worksheets("Sheet1").Range("G2:G100").Value = "PLEASE SELECT" Application.ScreenUpdating = True End Sub

4
Save and test the macro

Return to Excel, choose File > Save As, select Excel Macro-Enabled Workbook (*.xlsm), close and reopen the file, and select Enable Content if Excel displays a macro warning.

Confirm the target range: The procedure replaces existing values in the specified cells but does not remove their data-validation rules. Use a specific range so unrelated worksheet data is not overwritten.
Free Microsoft Office alternative

Manage Excel-compatible workbooks with a lightweight WPS Office alternative

WPS Office provides a free, lightweight spreadsheet experience with a familiar interface and compatibility with common Microsoft Office formats. Use it to open, review, and migrate Excel workbooks while keeping everyday spreadsheet editing simple.

  1. 1. Install WPS Office: Download and install WPS Office, then open WPS Spreadsheets from the main application screen.
  2. 2. Open the workbook: Choose Menu > Open, select the Excel workbook, and review the target worksheet and data-validation cells.
  3. 3. Edit and save a compatible copy: Make supported spreadsheet changes, then choose Menu > Save As and select an Excel-compatible format such as XLSX when a macro-free copy is appropriate.
Open and edit common Excel workbook formats, including XLSX and XLSM files, for easier migration.Use a familiar spreadsheet interface for reviewing data-validation ranges and workbook content.Work with a lightweight office suite for everyday spreadsheet tasks without a large installation.Keep documents compatible with Microsoft Office formats when sharing files with Excel users.
microsoft office alternative - wps office

Frequently Asked Questions

Where should the Workbook_Open VBA code be placed?

Place it in the ThisWorkbook module in the VBA editor. Press Alt+F11, expand the workbook project, and double-click ThisWorkbook under Microsoft Excel Objects.

Why does the Workbook_Open macro not run when the file opens?

The workbook may be saved as XLSX instead of XLSM, or macros may be disabled. Save it as an Excel Macro-Enabled Workbook and choose Enable Content when prompted.

Does resetting the cell value remove data validation?

No. Assigning a value such as PLEASE SELECT changes the cell contents but leaves the existing data-validation settings in place.

Can I reset a different worksheet or range?

Yes. Replace Worksheets("Sheet1") with the correct sheet name and change Range("G2:G100") to the required cell range. Use the exact worksheet name, including spaces.

How can I reset cells to blank instead of a prompt?

Replace the assigned text with an empty string, such as Worksheets("Sheet1").Range("G2:G100").Value = "". Test the change on a copy before using it in the original workbook.