Message box after drop down list has been used

pgrad

Board Regular
Joined
Dec 8, 2010
Messages
60
Hi All,

I am hoping to create a msg box after the user has selected from one drop down list which will instruct them to select from the next drop down list.

Is this possible? Or is there an alternative way to highlight / force them to complete all the drop down lists in a specific order?

Thanks
Paul
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hi Andrew

I'm using Data Validation lists in cells b1, b2 and b3 and then finally b8,

So either want to prompt or force users to complete them in that order.

Thanks
Paul
 
Upvote 0
It's difficult to force users to do anything. Why is the order important? You could use the Worksheet_Change event procedure to pop up a message box when each selection is made. Or you could just use some cells with formulas as prompts.
 
Upvote 0
Hi Andrew,

The order is not really important I guess, the main thing is that they are prompted to complete things and not leave blanks etc.

I am hoping to gather some data from very very low level users some of which we recently caught using typewriters! Hence the need for message to tell them exactly what to do and where to do it.

I'd never come across the worksheet_change event procedure but it looks like it will do the trick.

Thanks again
Paul
 
Upvote 0
Bear in mind that the users must enable macros for event procedures to fire. That may be beyond their ability.
 
Upvote 0
Yes, I was thinking I would address this in a briefing session..... unless there is a clever way of forcing them to run Macros, which I doubt there is due to the security issiue it would pose.
 
Upvote 0
Hi All,

This code is working fine.... but if I want to replicate this, so that once B3 has been changed via the drop down list I can generate one final msg instucting the user to do "xyz"


Private Sub Worksheet_Change(ByVal Target As Range)
'This will generate a message box when the value of b2 is changed via the dropdown list'
Dim Rng As Range
Set Rng = Intersect(Target, [B2])
If Not Rng Is Nothing Then
MsgBox "Please select your main place of work"
End If
'This selects cell B3
Range("B3").Select
End Sub

If I simply repeat the code I get the error message " Compile Error - Ambiguous Name Detected: Worksheet_Change"

I have tried renaming the second set of code but get the same error message.

Any advice would be much appreciated.

Thanks
Paul
 
Last edited:
Upvote 0
You can only have one Worksheet_Change event procedure. So you need to put all your code in there. Example:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'   This will generate a message box when the value of b2 is changed via the dropdown list'
    Dim Rng As Range
    Set Rng = Intersect(Target, [B2])
    If Not Rng Is Nothing Then
        MsgBox "Please select your main place of work"
'       This selects cell B3
        Range("B3").Select
        Exit Sub
    End If
    Set Rng = Intersect(Target, [B3])
    If Not Rng Is Nothing Then
        MsgBox "Whatever"
'       This selects cell B4
        Range("B4").Select
        Exit Sub
    End If
End Sub
 
Upvote 0
Andrew,

Once again thanks very much!

Thats working perfectly and I would never have figured out that you cannot have multiple Worksheet_Change event procedures.

Really appreciate all your help on here!

Cheers
Paul
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,713
Members
452,939
Latest member
WCrawford

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