Warning pop-up message from specific values chosen via drop-down list

Wheeze

New Member
Joined
Dec 19, 2017
Messages
1
I'm unsure how difficult/easy to achieve this is, it's certainly beyond my meagre efforts, so any help would be greatly appreciated!

I have a series of cells ranging from E5:AT21. Each of these cells allows selection of different phrases via Data Validation List drop-down menus. The options in the drop-down menu for each cell are as follows:

Site 1
Site 2
Site 3
A/L
Flexi

Essentially, what I need is for a warning message to appear, ideally via pop-up, whenever A/L or Flexi is selected from the drop-down options in any of the cells. The message should then read "Has this been authorised?" and have a "Yes" or "No" option (along with the usual cancel etc). I need this to happen only when the drop-down option is chosen.

Is this at all possible?

Many thanks!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Welcome to the Board!

This will require VBA. You can use a Worksheet_Change event procedure, which runs automatically when cells are updated.
Set up your Data Validation lists as you have. Then, right-click on the sheet tab name at the bottom of the screen, select "View Code", and paste this code in the VB Editor window:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    Dim myRange As Range
    Dim isect As Range
    Dim cell As Range
    Dim chk
    
'   Set range to apply this on
    Set myRange = Range("E5:AT21")
    
'   See if updated cell falls in range
    Set isect = Intersect(Target, myRange)
    
'   Run if cells are found in range
    If isect Is Nothing Then
        Exit Sub
    Else
        For Each cell In isect
            If (cell = "A/L") Or (cell = "Flexi") Then
                chk = MsgBox("Has this been authorized?", vbYesNo, "AUTHORIZATION")
                If chk = vbNo Then
                    Application.EnableEvents = False
                    cell.ClearContents
                    Application.EnableEvents = True
                End If
            End If
        Next cell
    End If

End Sub
This should do what you want.
 
Upvote 0

Forum statistics

Threads
1,214,984
Messages
6,122,601
Members
449,089
Latest member
Motoracer88

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