Validation ON List of values against by command button
To reference the range in a seperate workbook, use something like
Worksheets("CC").range("A2:A15")
As for not setting it at all, the program wouldn't know where to look
for the compare. Are the lists always in the same columns? If so, we
can automate the range dimension by finding the top row and bottom row
of the columns.
Just need a little more detail.
Alex wrote:
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
|