ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Data Validation? (https://www.excelbanter.com/excel-discussion-misc-queries/131590-data-validation.html)

sot

Data Validation?
 
I enter a Cost code into a cell and for all instances these cost codes are
allowed except for one. For this one exception, I want to allow the entry
but bring up a warning box to ask user to check the entry. Is this possible
in Data Validation or must I use some other way. I know I could just use and
IF, but I don't want to add another column to my worksheet.

Many thanks for any responses

Bob Phillips

Data Validation?
 
If you have a custom type in Validation with a formula to say

=H1<"my value"

and then on the error tab set the style to Warning, the message will come up
but the user can Continue.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"sot" wrote in message
...
I enter a Cost code into a cell and for all instances these cost codes are
allowed except for one. For this one exception, I want to allow the entry
but bring up a warning box to ask user to check the entry. Is this
possible
in Data Validation or must I use some other way. I know I could just use
and
IF, but I don't want to add another column to my worksheet.

Many thanks for any responses




Toppers

Data Validation?
 
I don't believe you can check using Data Validation but the code below would
allow a check. Insert this code into the worksheet where you want the check
to work.

Change $A$1 to the cell you require and 1234 to your "code".

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
On Error GoTo endsub
If Application.And(Target = Range("$A$1"), Target.Value = 1234) Then
MsgBox "Warning - check this code " & Target.Value
End If
endsub:
Application.EnableEvents = True
End Sub

HTH

"sot" wrote:

I enter a Cost code into a cell and for all instances these cost codes are
allowed except for one. For this one exception, I want to allow the entry
but bring up a warning box to ask user to check the entry. Is this possible
in Data Validation or must I use some other way. I know I could just use and
IF, but I don't want to add another column to my worksheet.

Many thanks for any responses



All times are GMT +1. The time now is 07:31 PM.

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