arthur_etchells
Board Regular
- Joined
- May 15, 2004
- Messages
- 169
Basically, I need the validation box to have as its source array a non-contiguous range of cell values. I couldn't get the validation list to take the non-contiguous range when entered in the formula1:= area, so I figured a named range would do the trick. However, I get an error at the validition.add line. The example below is a simplified mockup of the final version of the code, as the final version will need to draw on a larger number of cells.
Am I missing something here? Is it possible to use non-contiguous ranges in a validation drop-down like this?
Thanks for any help,
Arthur
Code:
Private Sub FillPickConditionFields(sh As Worksheet)
sh.Cells.Validation.Delete
ActiveWorkbook.Names.Add Name:="srtRng", RefersTo:="=Blur sheet!$A$4,Blur sheet!$E$4:$I$4"
With sh.Range("C1").Validation
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=srtRng"
.InCellDropdown = True
End With
End Sub
Am I missing something here? Is it possible to use non-contiguous ranges in a validation drop-down like this?
Thanks for any help,
Arthur