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

I'm trying to modify validation for adjacent celss on the fly depending on
the value of the previous cell. I've got this code but it is throwing an
error.

?????


If ActiveCell.Offset(0, -1).Value = "D" Then
'Range(Myaddress).Validation.Modify (xlValidateDate,
xlValidAlertInformation, _ xlBetween, ="1/1/2010", ="12/31/2020")

Endif
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Validation error

What I wound up with was:



If ActiveCell.Offset(0, -1).Value = "D" Then

With Range(Myaddress).Validation
.Delete
.Add Type:=xlValidateDate, _
AlertStyle:=xlValidAlertInformation, _
Operator:=xlBetween, _
Formula1:="1/1/2010", Formula2:="12/31/2020"
End With

Else

With Range(Myaddress).Offset(0, 1).Validation
.Delete
.Add Type:=xlValidateDate, _
AlertStyle:=xlValidAlertInformation, _
Operator:=xlBetween, _
Formula1:="1/1/2010", Formula2:="12/31/2020"
End With





"Hydra" wrote:

I'm trying to modify validation for adjacent celss on the fly depending on
the value of the previous cell. I've got this code but it is throwing an
error.

?????


If ActiveCell.Offset(0, -1).Value = "D" Then
'Range(Myaddress).Validation.Modify (xlValidateDate,
xlValidAlertInformation, _ xlBetween, ="1/1/2010", ="12/31/2020")

Endif

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
Data Validation error Lico_VBA Excel Programming 2 September 13th 08 03:40 PM
error on add validation ranswrt Excel Programming 2 July 25th 08 01:02 PM
Validation Error - Please Help!!! [email protected] Excel Programming 10 April 13th 07 05:31 PM
validation error, urgent plz help daroc Excel Worksheet Functions 1 January 23rd 06 10:25 PM
validation - error mismatch pmguerra[_2_] Excel Programming 0 January 20th 06 12:36 PM


All times are GMT +1. The time now is 11:43 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"