+ Reply to Thread
Results 1 to 3 of 3

Help with data validation loop - Inputting formulas throws errors

  1. #1
    Registered User
    Join Date
    06-18-2012
    Location
    california
    MS-Off Ver
    Excel 2010
    Posts
    13

    Help with data validation loop - Inputting formulas throws errors

    Essentially, the code below is supposed to select all cells between k2:k76 and do a data validation list with this formula as the source:
    Please Login or Register  to view this content.
    This is to allow for dependent validation (k2 validation corresponds to whatever the chosen value in j2, and so on). However, every time I try running the script, VB is giving me a "Application-defined or object-defined error." What is stranger is I recorded a macro of me inputting that source for a datavalidation list in excel. The macro works fine, but after I try running my script, the macro, which was previously working, no longer works. Any advice is appreciated.

    Please Login or Register  to view this content.
    Last edited by charliew001; 06-23-2014 at 07:24 PM.

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Help with data validation loop - Inputting formulas throws errors

    When it gives the error, click Debug, which will put you in the code with the current line highlighted. Hover over variables to see where it is in the process, and maybe you can figure it out.
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

  3. #3
    Registered User
    Join Date
    06-18-2012
    Location
    california
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Help with data validation loop - Inputting formulas throws errors

    OK, I figured it out. It was kind of a oversight on my part. The contents of the data validation cell in J$2$ cannot be empty, otherwise VBA throws an Object-defined error. If I attempted to input the dependent validation in K$2$, excel would throw me an error dialogue box but still proceed.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Highlight Errors with Data Validation
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-19-2013, 02:15 PM
  2. 2007 VBA Code in 2010 Throws Multiple Errors: Runtime Error 91 and more
    By VB@N3wb|3 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-23-2013, 09:54 AM
  3. [SOLVED] Data check/validation when inputting?
    By Smudge.Smith in forum Excel General
    Replies: 3
    Last Post: 01-20-2013, 06:53 PM
  4. [SOLVED] Data Validation Errors
    By Ryuujin in forum Excel General
    Replies: 4
    Last Post: 07-29-2012, 06:54 AM
  5. Replies: 1
    Last Post: 06-09-2012, 10:02 AM

Tags for this Thread

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