+ Reply to Thread
Results 1 to 2 of 2

copying validation list in VBA

  1. #1
    Registered User
    Join Date
    05-01-2009
    Location
    Roseville, CA
    MS-Off Ver
    Excel 2007
    Posts
    1

    copying validation list in VBA

    I realize that this is an old thread but I was having a similar problem and none of the workarounds I found on the web were adequate.

    http://www.excelforum.com/excel-prog...st-in-vba.html

    If you are trying to add validation and receive "Error 1004: Application or object defined error." This is because the formula you are applying to the validation evaluates to an error on the first cell in the range that the validation is being added to.

    To solve this, I had another location in the worksheet that had the same relative data validation formula. I Selected that cell in VBA and used the Copy method. The I selected the range that I needed the data validation applied to and did a Selection.Pastespecial and pasted only the validation. The line of code is shown below.

    Please Login or Register  to view this content.
    This allowed the procedure to run without error.
    Last edited by VBA Noob; 05-01-2009 at 05:04 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    re: copying validation list in VBA

    Welcome to the forum.

    It's thoughtful of you to post your solution, thank you.
    Entia non sunt multiplicanda sine necessitate

+ 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