Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Data Validation & Worksheet_change
I am trying to use data validation to restrict users to a list of people's
names, which is contained in range somewhere in the file. However, I'd like the user to enter a different name if they really want to. If they do, I've got to intercept it, validate it, and then add it into the list for future reference in the data validation. I've changed the Data Validation to not create an immediate error alert. My approach to this was within the Worksheet change event. Private Sub Worksheet_Change(ByVal Target As Range) If Not (Intersect(Target, Range("lstLaborInputName")) Is Nothing) Then If Target.Validation.Value = False Then 'code to validate and add to valid to list End If End If End Sub Where the first IF statement decides whether the change took place in the area I want to evaluate. However, the Target.Validation.Value is always returning true, regardless of what is entered when I make the change. Here's the wierd part, though, if I undo what I typed and the cell is still "invalid", the code triggers. If the undo value is valid, it doesn't, i.e. the code seems to work fine. Does using the Data Validation dropdown not trigger a worksheet change event? I can't find any references to that, Any ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Update on Worksheet_change with data from other sheets? | Excel Programming | |||
clearcontents, worksheet_change, cell validation | Excel Programming | |||
MS Bug? Data validation list dropdown with Worksheet_Change event | Excel Programming | |||
worksheet_change vs. calculate, and worksheet_change not running | Excel Programming | |||
worksheet_change vs. calculate, and worksheet_change not running | Excel Programming |