Data validation warning meesage

marshen

New Member
Joined
Apr 4, 2016
Messages
35
Office Version
  1. 365
Platform
  1. Windows
Hi all.

I have a cell with a data validation drop down in with the options of YES or NO and I want a error/warning message to pop up when YES is selected but no message when NO is selected.

I have no issues with getting the drop down menu via Data Validation and I know the option for an error/warning message is in there too but I want it to pop up when the YES option is selected but I just can't seem to grasp it:(

Any advice would be appreciated.

Mark
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Mark

As far as I know you can't have a error/warning message when using a list, probably because all the values selected in the list are considered valid.
 
Upvote 0
Maybe try a sheet change event macro, something like this.
In the sheet module, using A1 as the drop down cell.

Howard

Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
Application.EnableEvents = False
Dim myCheck
    myCheck = MsgBox("Yes was entered.", vbRetryCancel)
    If myCheck = vbRetry Then
       [A1].ClearContents
       [A1].Activate
      Else
       '
    End If
End If
Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top