Need help with excel message pop up [Solved/Closed]

Report
-
 Trowa -
I need Excel VB help to show a message pop up box to display whenever the value is below 10 or greater then 50 that's also not a multiple of 5

3 replies

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
766
you need help with msgbox or the if statement ?
I don't know what would easier. I basically want only certain values to be valid in a specific field. And if an incorrect value is added a message to display
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
766
Is it for data validation ? By this I mean do you want prevent user to type in any thing that is less than 10 or have any thing greater than 50 which is not a multiple of 5
Hi Rizvisa,

I was just checking the forum and came to this post. I'm curious how you would apply data validation with two statements: only allow a number between 10 and 50 which isn't divisible by 5.

Best regards,
Trowa
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
766
Hey Trowa. how that graph thing is coming up.

This work for me for the original question, in the validation I have this formula

=IF(A1="",TRUE,IF(OR(A1<10,AND(A1>50,MOD(A1,5)<>0)),FALSE,TRUE))

it allows if data is either "", or is >10 and <50 or is >50 but is a multiple of 5


For your question to only allow a value between 10 and 50 when it is not divisible by 5
=IF(A1="",TRUE,IF(OR(A1<10, A1>50, MOD(A1,5)=0),FALSE,TRUE))

or this
=NOT(AND(A1<>"",OR(A1<10,A1>50,MOD(A1,5)=0)))
Thanks Rizvisa for your answer. Some knowledge just fades away after not using it for a while. That's why I use this forum to keep my Excel muscles in shape. Thanks for helping me with my exercise :).

My graph is working very smoothly, thanks for asking!

Kind regards,
Trowa

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!