Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I used the macro recorder to record the setting up of data validation in certain cells. It came up with the following code. Range("C2:C200").Select With Selection.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:="=INDIRECT(A2&B2)" .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "" .ShowInput = False .ShowError = False End With During the recording process, when I entered the validation formula, I got a message saying: The source currently evaluates to an error. Do you wish to continue? So I clicked 'Yes' and continued. When I run the macro, it stops at the line: .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:="=INDIRECT(A2&B2)" and I get an error message: Run-time error 1004 Application-defined or object-defined error Is there any way around this? I want the data validation even though it currently evaluates to an error. Regards - Dave. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007-macro programming logic for data validation | Excel Discussion (Misc queries) | |||
Excel 2007-programming macros that apply to data validation | New Users to Excel | |||
Validation add method fail when programming Excel with VBA | Excel Programming | |||
Data Validation Programming | Excel Programming | |||
Validation (Drop down list vs simple text length validation) | Excel Programming |