Show a Message Box for an Excel Drop-Down Selection
Question details
Display a confirmation message when a specific data-validation value is selected in a worksheet range.

- 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.
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.
Add a Worksheet_Change event to the worksheet
Use a worksheet event macro to display the NCR question when one matching cell changes.
In desktop Excel, right-click the relevant sheet tab and select View Code. This opens the VBA editor at that worksheet’s code module.
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
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.
On the worksheet, select "6. Letter Review Complete" from a drop-down in E13:E1000 and verify that the message appears.

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.

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.




