+ Reply to Thread
Results 1 to 5 of 5

Dependent Validation Generates an Error

  1. #1
    Registered User
    Join Date
    08-22-2008
    Location
    UK
    Posts
    13

    Dependent Validation Generates an Error

    My code:

    Please Login or Register  to view this content.
    All of the variables have been declared and the first validation for column D works as expected but when we get down to the .Add for the second validation (for column E) I get a 1004 runtime error.

    Any ideas?

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,280

    Re: Dependent Validation Generates an Error

    Does that formula evaluate to an error at the time you run the code?
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    08-22-2008
    Location
    UK
    Posts
    13

    Re: Dependent Validation Generates an Error

    Yes it does. If I try to add the formula manually I get an error telling me that the source generated an error and do I want to continue but it accepts the formula after I say yes. If I allow the code to add the formula it just generates a 1004 runtime error.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,280

    Re: Dependent Validation Generates an Error

    I think your only option is to ensure the formula returns a valid range, at least temporarily, so that you can add the validation. Error handling won't help here.

  5. #5
    Registered User
    Join Date
    08-22-2008
    Location
    UK
    Posts
    13

    Re: Dependent Validation Generates an Error

    I managed to get it working by defaulting the cells in column D to a particular value and then ensured that the value was also in the lookup list that the validation for column E was using:

    Please Login or Register  to view this content.
    The error was being caused by the fact that the cells in column D were defaulting to a blank cell. Thanks for your help though.

+ 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