VBA & Macro Problems

Show a Message Box for an Excel Drop-Down Selection

Steven ParkerSteven Parker Nov 27, 2026 869 views

Question details

Display a confirmation message when a specific data-validation value is selected in a worksheet range.

Show a Message Box for an Excel Drop-Down Selection
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user selects a value from a data-validation drop-down in cells E13:E1000.
Observed behavior
When the selected value is "6. Letter Review Complete", Excel should ask whether NCRs have been raised.
Before you start

Open the workbook in desktop Excel and confirm that the drop-down cells are in E13:E1000 and the option text matches "6. Letter Review Complete" exactly. Excel for the web cannot run VBA macros.

Solution 1Recommended

Add a Worksheet_Change event to the worksheet

Use a worksheet event macro to display the NCR question when one matching cell changes.

1
Open the worksheet module

In desktop Excel, right-click the relevant sheet tab and select View Code. This opens the VBA editor at that worksheet’s code module.

2
Insert the event procedure

Paste the following code into the worksheet module. If a Worksheet_Change procedure already exists there, incorporate the logic into that procedure instead of creating a duplicate. Private Sub Worksheet_Change(ByVal Target As Range) Dim response As VbMsgBoxResult If Target.CountLarge <> 1 Then Exit Sub If Intersect(Target, Me.Range("E13:E1000")) Is Nothing Then Exit Sub If IsError(Target.Value2) Then Exit Sub If Target.Value2 <> "6. Letter Review Complete" Then Exit Sub On Error GoTo CleanUp Application.EnableEvents = False response = MsgBox("Have NCRs been raised?", vbQuestion + vbYesNoCancel, "NCR confirmation") CleanUp: Application.EnableEvents = True End Sub

3
Save as a macro-enabled workbook

Choose File > Save As and select Excel Macro-Enabled Workbook (*.xlsm). Close and reopen the file if needed, then enable macros only if you trust the workbook.

4
Test the drop-down

On the worksheet, select "6. Letter Review Complete" from a drop-down in E13:E1000 and verify that the message appears.

Add a Worksheet_Change event to the worksheet
What the buttons do: Yes, No, and Cancel dismiss the message; this code does not change or undo the selected value. It ignores multi-cell changes and restores Excel events if an error occurs after events are disabled.
Free Microsoft Office alternative

Work with Excel spreadsheets in WPS Office

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface for working with Office files. Open compatible Excel workbooks to make migration easier; the Excel-specific VBA event described above is not guaranteed to run in WPS.

Work with spreadsheet drop-downs and other worksheet contentCompatible with Microsoft Excel formats such as XLSX and XLSFamiliar interface for editing spreadsheetsFree and lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does the message not appear after I select the value?

Check that the code is in the correct worksheet module, the file is saved as .xlsm, and trusted macros are enabled. The selection must be in E13:E1000 and match "6. Letter Review Complete" exactly.

Can I run this macro in Excel for the web?

No. Open the workbook in desktop Excel to run the Worksheet_Change VBA event.

Will selecting No or Cancel undo the drop-down selection?

No. The example only displays the message and records the response; it does not undo the selection or prevent the user from continuing.

What happens if I paste values into several cells at once?

The example exits when Target contains more than one cell, so a multi-cell paste will not display the message.