title: VBA Error 13 Type Mismatch
body: <p>I am trying to add a line of cells in a sheet to a multicolumn listbox in a userform. The number of columns in the sheet also varies. I keep getting the error 'Type mismatch.' Stepping through my code I found that it occurs at the first .AddItem line. I found out that you cannot add multiple items with .AddItem. Is there another method to do this? I'm very new to vba. Thanks for your help! </p>
  
  <pre><code>Private Sub GenerateButton_Click()
    Dim i As Long, counter As Long, counter_RA As Long, x As Integer
    Dim LastColRA As Long, LastColCP As Long
  
  
    LastColRA = Sheet1.Cells(1, Columns.Count).End(xlToLeft).Column
    LastColCP = Sheet2.Cells(1, Columns.Count).End(xlToLeft).Column
  
  
    'Check to make sure that enough items were selected
    For x = 0 To ListBox2.ListCount - 1
      If ListBox2.Selected(x) Then
        counter_RA = counter_RA + 1
        With TabData.DataTable
          .AddItem Sheets(Sheet1).Range(Cells(x + 2, 1), Cells(x + 2, LastColRA)).Text
        End With
      End If
    Next x
  
    For i = 0 To ListBox1.ListCount - 1
      If ListBox1.Selected(i) Then
        counter = counter + 1
        With TabData.DataTable
          .AddItem Sheets(Sheet2).Range(Cells(i + 2, 1), Cells(i + 2, LastColCP)).Text
        End With
      End If
    Next i
  End Sub
  </code></pre>