Worksheet event comparing contents of dropdown boxes to range- grateful for any help

nzamparo

New Member
Joined
Jun 2, 2011
Messages
3
Looking for help with the following situation, am grateful for any help:

Worksheet "A":

A1: Dropdown Box (Options are Appetizers, Soups, Entrees, Desserts)
A2: Dropdown Box (Same as above)
A3: Dropdown Box (Same as above)
...

Worksheet "B":

A1: Appetizers
A2: Soups
A3: Entrees
A4: Desserts

I would like to be able to compare the contents of all of the filled dropdown boxes from Worksheet "A" (A1:A3...) to each of the text strings in Worksheet "B" (A1:A4).

If none of the filled dropdown boxes equal one of the text strings in Worksheet "B" (A1:A4), I would like a message to display (i.e. "Have you considered Appetizers?" should display if Appetizers is not selected in a dropdown box).

If none of the dropdown boxes are selected or at least one of the dropdown boxes from Worksheet "A" (A1:A3...) equal each of the text strings in Worksheet "B", no message should display.

Can anyone offer some advice? I will post the code I've managed to compile below as a starting point.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE = "A11:A4"

If Target.Cells.Count > 1 Then Exit Sub

If Range("A1:A4").Value = "Appetizers" Then
MsgBox "Have you considered Appetizers?"
' If sales rep has not created order entry from the Appetizer product category, display a message.

If Range("A1:A4").Value = "Soups" Then
MsgBox "Have you considered Soups?"
' If sales rep has not created order entry from the Soups product category, display a message.

If Range("A1:A4").Value = "Entrees" Then
MsgBox "Have you considered Entrees?"
' If sales rep has not created order entry from the Entree product category, display a message.

If Range("A1:A4").Value = "Desserts" Then
MsgBox "Have you considered Desserts?"
' If sales rep has not created order entry from the Desserts product category, display a message.

Else
' Sales rep has created order entry from each product category, no message displayed.


End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,259
Members
452,901
Latest member
LisaGo

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