+ Reply to Thread
Results 1 to 2 of 2

VBA for data validation --> Method 'Add' of object 'Validation' failed

  1. #1
    Forum Contributor
    Join Date
    09-30-2009
    Location
    Barcelona
    MS-Off Ver
    Excel 2010
    Posts
    274

    VBA for data validation --> Method 'Add' of object 'Validation' failed

    for some reason I can't get it to work it wright
    even copiying the code from the help file will not work

    any clue what could be going on?

    With Range("e5").Validation
    .Add Type:=xlValidateWholeNumber, _
    AlertStyle:=xlValidAlertInformation, _
    Formula1:="5", Formula2:="10"

    .InputTitle = "Integers"
    .ErrorTitle = "Integers"
    .InputMessage = "Enter an integer from five to ten"
    .ErrorMessage = "You must enter a number from five to ten"
    End With

    error number -2147417848
    error helpcontext 1000440

    error description : Method 'Add' of object 'Validation' failed

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: VBA for data validation --> Method 'Add' of object 'Validation' failed

    Please wrap your code in code tags, before the moderators get you...

    Forum rules
    3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # button at the top of the post window. If you are editing an existing post, press Go Advanced to see the # button.
    Then try this
    Please Login or Register  to view this content.

    Hope this helps
    Last edited by Marcol; 09-10-2010 at 06:31 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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