validate a cell value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to determine if a cell value is contained within a valadation range
found in another sheet.

I have been trying varous combinations of worksheet functions MATCH and
ISNA, as well as VBA ISERROR function, but keep getting fatal errors when
cell value is not found in the valadation range.
 
If you're trying to do this in VBA, one possibility is this:
Dim cl as Range 'Cell
Dim str1 as String 'String to match
Dim Found as Boolean
str1 = Range("A1").Value 'Your cell
For Each cl in Range(ValidationRange) 'Assumes "ValidationRange" is a
valid named range
If cl = str1 Then Found = True
Next
MsgBox Found

HTH

Die_Another_Day
 
Need a little more info. Are you trying to validate that a cell being input
is contained within your validation list, or are you trying to validate that
the values in an existing list all match the values in the validation range
or...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top