Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I found this code that makes a DV drop down.
The example to populate the array was like this, which produced a DV with selections of 1, 2, 3, 4, 5. Dim ValidationList(5) As Variant Using the example from a Chip P's site (commented out in the code) I want the list in column F to be the DV source list. The only difference I see is the array name and the range to read into it. But it throws a subscript out of range error. Thanks, Howard Sub DV_Test() Dim ValidationList() As Variant, i As Integer ValidationList = Range("F1:F10") ' Dim Arr() As Variant ' Arr = Range("A1:A10") For i = 0 To UBound(ValidationList) ValidationList(i) = i + 1 Next With Range("A1").Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _ Operator:=xlEqual, Formula1:=Join(ValidationList, ",") .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "" .ShowInput = True .ShowError = True End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Read a Range into an Array | Excel Programming | |||
Read range to array | Excel Programming | |||
How do i read Selection.Shapes.Range(Array(i)? | Excel Programming | |||
Read a range to an array | Excel Programming | |||
Read Range Data into Array | Excel Programming |