+ Reply to Thread
Results 1 to 3 of 3

validate a cell value

  1. #1
    Richard
    Guest

    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

  2. #2
    Die_Another_Day
    Guest

    Re: 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



  3. #3
    Jim Thomlinson
    Guest

    RE: 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


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1