Display a message box when validation criteria is violated

Nitehawkhp

New Member
Joined
Dec 2, 2016
Messages
37
I’m trying to use a msgbox to provide instructions if validation criteria are violated. I’m able to get the validation configured, but I would like a different message box to appear when the entered data is outside the validation criteria.

For example, the validation criteria require the entered numbers must be >0 and <
<entered amount="" <100.="" if="" there="" is="" an="" entry="" <0="" or="">100. If the entry is outside the criteria the default msgbox is displayed stating “This value doesn’t match the data validation restrictions defined for this cell.”

I would like to provide additional information stating that the entry must be
<entered amount="" <100.
0 < entered amount < 100.
I don’t know how to do that type of thing.

Any help would be greatly appreciated.

Rod
</entered></entered>
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Simply click on the "Error Alert" tab in the DV & enter your message in the "Error message" box
 
Upvote 0
When you configure the data validation, you will see a tab that says "Error Alert" . Type your message in the "Error message" box.
 
Upvote 0
Thanks! That's almost too easy.

However, I just discovered an error in my validation formula...

How do I set it up so it will check for greater than 0 and less than 100 for valid entry?
 
Upvote 0
Try:
=AND(A1>0, A1<100)
 
Upvote 0
What range of cells has data validation?
 
Upvote 0
I'm using all of column J and I put the formula you gave me in the custom validation section.
 
Upvote 0
Did you change the cell reference? =AND(J1>0, J1<100)
It worked for me.
 
Upvote 0
Did you change A1 to J1?
 
Upvote 0

Forum statistics

Threads
1,215,198
Messages
6,123,589
Members
449,109
Latest member
Sebas8956

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