Validation ON List of values against by command button
I've actually got the highlight part down, but still need help in set
comparelist on a different worksheet. Also, is there a way not to specify a
range. Because both the entered and compare list will always be different.
In other words have it select the range based if the value is not null.
"JW" wrote:
Something like this. Of course, you would programatically create your
ranges dimensions if they are subject to change.
Dim cl As Range, enteredList As Range, compareList As Range
Set enteredList = Range("A2:A15")
Set compareList = Range("C2:C15")
For Each cl In enteredList
If WorksheetFunction.CountIf(compareList, cl.Value) = 0 Then
MsgBox "not in list"
Else
MsgBox "in list"
End If
Next cl
Set entereList = Nothing
Set compareList = Nothing
Alex wrote:
Thank you in advance
I need a command button to check if a list of values I input actually are in
another list on a different worksheet. If they are not in the list it would
be highlighted a color. I understand there are easier ways (conditional
formatting, drop down, etc) but my boss wants it done specifically this way.
Please help
-Thank you, Alex
|