title: Drop down list using arrays excel vba
body: <p>I'm trying to use a cell to select different data (from data validation and choosing list). The data in the list is from a data base filtered out.</p>
  
  <p>I'm trying to take the data from the data base and put it into an array and then use that array to populate the list.</p>
  
  <p>Not sure why this isn't working so any help is appreciated.</p>
  
  <pre><code>Sub filters()
  
  Dim find As String
  Dim array1(50)
  Dim i As Integer
  Dim j As Integer
  Dim k As String
  
  Worksheets("Email Address").Select
  
  find = Worksheets("Sheet1").Range("B2").Value
  For i = 2 To 400
  k = Worksheets("Email Address").Cells(i, 1)
  If k = find Then
      array1(j) = Worksheets("Email Address").Cells(i, 2)
  
  Else
  
  End If
  Next i
  
  Worksheets("Sheet1").Select
      Range("G10").Select
      With Selection.Validation
          .Delete
          .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
          xlBetween, Formula1:= _
          array1
          .IgnoreBlank = True
          .InCellDropdown = True
          .InputTitle = ""
          .ErrorTitle = ""
          .InputMessage = ""
          .ErrorMessage = ""
          .ShowInput = True
          .ShowError = True
      End With
      Range("G10").Select
  
  End Sub
  </code></pre>