Message box with condition

rollo

New Member
Joined
Feb 15, 2002
Messages
43
I have a worksheet which has a column of numbers (Col A) and a Yes/No dropdown list (Col C). Users have to look at the numbers in column A and if the number is =>1, they select Yes from the dropdown in Col C, if the number is 0 they select No

Eg A…………………C
1…………………Yes
0…………………No
1…………………Yes
1…………………Yes
What I need is a message box that will trigger if the user has not selected Yes (or No) where one or more of the cells in Col A =>1 (or the cells equal 0), and also prevents closure of the worksheet until the user has made the correct response.
I prefer not to use Data Validation as I would like the message to jump in front of the user, with the additional feature of preventing the user from exiting the worksheet before selecting from the dropdown list.
Would greatly appreciate any help that you guys can give.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Sounds like you should be using the Workbook_BeforeClose event in ThisWorkbook.

And a Userform of your own creation.

I assume the sequence of events in _BeforeClose to be:

TallyResponses
If Not TallyOK, then
Userform.Show
Cancel=True 'This cancels the closing of the workbook
End if

At this point, user is obligated to return to worksheet, complete the questions, and then press the existing Exit/OK/Done button on the sheet. Or perhaps they just close?
 
Upvote 0

Forum statistics

Threads
1,225,071
Messages
6,182,679
Members
453,132
Latest member
nsnodgrass73

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