error on add validation

R

ranswrt

I get an error on the 'add' line of the following code:

With rng.Validation
.Delete
.Add Type:=xlValidateDecimal, AlertStyle:=xlValidAlertStop,
Operator:=xlGreater, Formula1:="-9999999999999999"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = "Error"
.InputMessage = ""
.ErrorMessage = "Must be an Amount."
.ShowInput = True
.ShowError = True
End With

I set rng to a range on the worksheet. What can I look for that would be
causing this error?
Thanks
 
G

Gary Brown

It works for me. The only issues MIGHT be...
1) I don't see you declaring rng as Range
2) -9999999999999999 seems a bit excessive.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top