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:

vb Code:
  1. With Selection.Validation
  2.        .Delete
  3.        .Add Type:=xlValidateWholeNumber, AlertStyle:=xlValidAlertStop, _
  4.        Operator:=xlBetween, Formula1:=1, Formula2:=65536
  5.        .IgnoreBlank = True
  6.        .InCellDropdown = True
  7.        .InputTitle = ""
  8.        .ErrorTitle = "Integers"
  9.        .InputMessage = ""
  10.        .ErrorMessage = "You must enter a number from 1 to 65536"
  11.        .ShowInput = False
  12.        .ShowError = True
  13. End With

what am i doing wrong?