Results 1 to 7 of 7

validation macro doesn't work

Threaded View

  1. #1
    Registered User
    Join Date
    01-17-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    11

    Question validation macro doesn't work

    i've written a macro that selects a range of cells (that part works) then sets data validation for those cells. it doesn't cause an error but it doesn't stop alphabetic characters being typed in the cells as its supposed to.

    heres my code:

    With Selection.Validation
           .Delete
           .Add Type:=xlValidateWholeNumber, AlertStyle:=xlValidAlertStop, _
           Operator:=xlBetween, Formula1:=1, Formula2:=65536
           .IgnoreBlank = True
           .InCellDropdown = True
           .InputTitle = ""
           .ErrorTitle = "Integers"
           .InputMessage = ""
           .ErrorMessage = "You must enter a number from 1 to 65536"
           .ShowInput = False
           .ShowError = True
    End With
    what am i doing wrong?
    Last edited by .paul.; 01-26-2009 at 01:08 PM.

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