ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Validation (https://www.excelbanter.com/excel-programming/386904-validation.html)

Guye

Validation
 
hi all,
one more short question.
i need to creat on certain columns on a worksheet the following
validation.
the number should be between 0-1000, in case that the nuber is above
500 a message will appear with a certain warning, but the cell will
not be blocked and the value above 500 will be entered as usual.
thanks a lot


joel

Validation
 
You can use a worksheet changge function such as the one below. You need to
add all the columns you need to be validated. I assume you had a validation
already set for 1 - 1000. You could eliminate the validation and make all
your checks in the worksheet change


Sub worksheet_change(ByVal Target As Range)

If Target.Column = 1 Then

If (Target 500) And (Target <= 1000) Then

MsgBox ("Value needs to be between 1 and 1000")

End If
End If

End Sub

"Guye" wrote:

hi all,
one more short question.
i need to creat on certain columns on a worksheet the following
validation.
the number should be between 0-1000, in case that the nuber is above
500 a message will appear with a certain warning, but the cell will
not be blocked and the value above 500 will be entered as usual.
thanks a lot



Guye

Validation
 
thanks Joel, it works perfectly



All times are GMT +1. The time now is 03:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com