D
Dave
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.
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.