title: VBA gives error Run-time '-2147352571 Excel when filling a text area
body: <p>im trying to make a form that shows info from cells, but when i enter a search, it gives this error.
  I think it's because there are problems with the data types, but i don't know how to fix it, probably problem with the date field, as far as i could investigate.</p>
  <pre><code>
  Private Sub ComboBox1_Change()
      TextBox1.Enabled = ComboBox1.ListIndex &lt;&gt; -1
  End Sub
  
  'add a listobject datarow range to a listbox
  Private Sub RowToList(rw As Range, lst As MSForms.ListBox)
      Dim i As Long, r As Long
      lst.AddItem
      r = UBound(lst.List, 1)
      For i = 1 To rw.Cells.Count
          lst.List(r, i - 1) = rw.Cells(i)
      Next i
  End Sub
  
  'this is the one place to edit the source listobject
  Private Function SourceList() As ListObject
      Set SourceList = Hoja1.ListObjects(&quot;TablaPrincipal&quot;)
  End Function
  
  'clear a listbox
  Private Sub ClearList(lst As MSForms.ListBox)
      If Len(lst.RowSource) &gt; 0 Then
          lst.RowSource = &quot;&quot;
      Else
          lst.Clear
      End If
  End Sub
  
  Private Sub MultiPage1_Change()
  
  End Sub
  
  Private Sub TextBox1_Change()
  
      Dim rw As Range, v, lo As ListObject, i As Long
      Dim colNum As Long
      
      Set lo = SourceList
      v = Me.TextBox1.Value
      ClearList Me.Lista
      
      If Len(v) &gt; 0 Then 'any search term?
          colNum = Me.ComboBox1.ListIndex + 1 'which column are we searching on?
          For Each rw In lo.DataBodyRange.Rows
              If UCase(rw.Cells(colNum).Value) Like &quot;*&quot; &amp; UCase(v) &amp; &quot;*&quot; Then 'check the relavant column
                  RowToList rw, Me.Lista
              End If
          Next rw
      Else
          Me.Lista.RowSource = lo 'no search term: reload the whole table
      End If
  End Sub
  
  Private Sub UserForm_Activate()
      Me.Lista.RowSource = SourceList
      Me.Lista.ColumnCount = SourceList.DataBodyRange.Columns.Count 'dynamic
  End Sub
  
  Private Sub UserForm_Initialize()
      Dim myList As ListObject, ListHeaders As Range
      Dim Headers() As String, i As Long
      Set myList = SourceList
      Set ListHeaders = myList.HeaderRowRange
      ReDim Headers(ListHeaders.Cells.Count - 1)
      For i = 0 To ListHeaders.Cells.Count - 1
          Headers(i) = ListHeaders.Cells(i + 1)
      Next
      Me.ComboBox1.List = Headers
  End Sub
  </code></pre>
  <p>Here are some images of the excel and error itself:
  <a href="https://i.stack.imgur.com/GJrGC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GJrGC.png" alt="The Excel table" /></a>
  <a href="https://i.stack.imgur.com/48pUz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/48pUz.png" alt="The form without the error, showing everything of the table" /></a>
  <a href="https://i.stack.imgur.com/t2Pnv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t2Pnv.png" alt="The error" /></a>
  <a href="https://i.stack.imgur.com/rxvP8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rxvP8.png" alt="Debugger" /></a></p>
  <p>I hope anyone can help me fix this problem please, thanks in advance!</p>