title: Excel Validation Drop Down list using VBA
body: <p>I have an array of values. I want to show those values in Excel Cell as drop down list using VBA.</p>
  
  <p>Here is my code. It shows "<strong>Type Mismatch Error!</strong>"</p>
  
  <pre><code>Dim xlValidateList(6) As Integer
  xlValidateList(1) = 1
  xlValidateList(2) = 2
  xlValidateList(3) = 3
  xlValidateList(4) = 4
  xlValidateList(5) = 5
  xlValidateList(6) = 6
  
  With Range("A1").Validation
  .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
  xlBetween, Formula1:=ValidationList
  .IgnoreBlank = True
  .InCellDropdown = True
  .InputTitle = ""
  .ErrorTitle = ""
  .InputMessage = ""
  .ErrorMessage = ""
  .ShowInput = True
  .ShowError = True
  End With
  </code></pre>
  
  <p>The problem occurs in following line...</p>
  
  <pre><code>.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
  </code></pre>
  
  <p>Please let me where the problem is... Thanks in advance</p>