title: Data Validation List Error
body: <p>I'm trying to add a data validation pulldown list, and I've been debugging it for a while to no avail.  I'm getting a Run-time error 1004, Application-defined or object defined error.  The error occurs in Formula1 setting part of the <code>Validation.Add</code> statement.  </p>
  
  <p>I've tried using a string reference to a named range, a string reference to a standard range, and, as shown below, a comma delimited list string generated from the list on the worksheet as shown in the code below.  I have checked the list string with <code>Debug.Print</code> and got the expected result.</p>
  
  <pre><code>Sub addPT_Validation()
  Dim sValidationList As String
  Dim cell As Range
  
  For Each cell In ThisWorkbook.Names("PT_Puldown").RefersToRange
      sValidationList = sValidationList &amp; cell.Value &amp; ","
  Next cell
  
  sValidationList = Left(sValidationList, Len(sValidationList) - 1)
  
  With ActiveSheet.Range("D14").Validation
      .Add Type:=xlValidateList, _
              AlertStyle:=xlValidAlertStop, _
              Operator:=xlEqual, _
              Formula1:=sValidationList
      .IgnoreBlank = True
      .InCellDropdown = True
      .ShowError = True
  End With
  End Sub
  </code></pre>
  
  <p>Thanks in advance for any guidance.</p>