ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   validate a cell value (https://www.excelbanter.com/excel-programming/367221-validate-cell-value.html)

Richard

validate a cell value
 
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.

--
Richard

Die_Another_Day

validate a cell value
 
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
Richard wrote:
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.

--
Richard



Jim Thomlinson

validate a cell value
 
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...
--
HTH...

Jim Thomlinson


"Richard" wrote:

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.

--
Richard



All times are GMT +1. The time now is 08:03 AM.

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