Using excel 2000, I am trying to insert a data validation list using the following code:
Range("C8").Select
Selection.Name = "SuburbV"
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=INDIRECT($A$6)"
.IgnoreBlank = True
.InCellDropdown = True
End With
However, the argument Formula1:="=INDIRECT($A$6)" produces the following error:
Run Time Error 1004:
Application-defined or object-defined error
The code works when I change the formula to :="A1:A6" , however this does not produce the same result that I require with the indirect statement.
Any suggestions?
Range("C8").Select
Selection.Name = "SuburbV"
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=INDIRECT($A$6)"
.IgnoreBlank = True
.InCellDropdown = True
End With
However, the argument Formula1:="=INDIRECT($A$6)" produces the following error:
Run Time Error 1004:
Application-defined or object-defined error
The code works when I change the formula to :="A1:A6" , however this does not produce the same result that I require with the indirect statement.
Any suggestions?