Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default error on add validation

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 209
Default error on add validation

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.
--
Hope this helps.
Thanks in advance for your feedback.
Gary Brown


"ranswrt" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 209
Default error on add validation

- Is the range protected?
- Does the range contain more than one cell?
--
Hope this helps.
Thanks in advance for your feedback.
Gary Brown


"ranswrt" wrote:

I changed it to -9000000 and I get an error. rng is declared as a range. I
used rmng with some other with statements and it works fine. The error I get
is

Method 'add' of object 'validation' failed.

I added rng.select before the with statement and it seemed to have stopped
the error. The procedure had been working earlier then it quit working. I
don't understand why. Any ideas?

"Gary Brown" wrote:

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.
--
Hope this helps.
Thanks in advance for your feedback.
Gary Brown


"ranswrt" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation Object error Peter Zinniker Excel Programming 7 August 13th 07 04:18 PM
Validation Error - Please Help!!! [email protected] Excel Programming 10 April 13th 07 05:31 PM
trap error in validation rw Excel Programming 6 February 2nd 06 03:32 PM
validation - error mismatch pmguerra[_2_] Excel Programming 0 January 20th 06 12:36 PM
Data Validation Error! keepitcool Excel Programming 2 August 19th 03 12:23 PM


All times are GMT +1. The time now is 10:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"