title: Excel VBA: ListBox-UserForm Variable creation issue
body: <p>Checked other similar questions on other websites, but could not find a solution.</p>
  
  <p>I am trying to generate variables from the contents of a listbox-userform. The contents in the list are the names of workbooks. The first piece of code shows you how I generate the contents of the list for your reference. The second piece of code is the one with the issue. </p>
  
  <pre><code>Private Sub CommandButton1_Click()
      Dim wb As Workbook
  
      For Each wb In Workbooks
          With ListBox1
              .AddItem (wb.Name)
          End With
      Next wb
  lbl_Exit:
  End Sub
  </code></pre>
  
  <p>I am getting a <code>Object Required</code> error on the For Each line below. This piece of code resides in the <code>Userform</code>. </p>
  
  <pre><code>Private Sub CommandButton3_Click()
      Dim MainBook As Workbook
      Dim ListBox1 As ListBox
  
      For Each Item In ListBox1
          If Item.Name Like "Aggregate" Then
              Item.Select
              Set MainBook = Selection
          End If
      Next
  End Sub
  </code></pre>
  
  <p><strong>Note</strong>: I read that <code>Item</code> is a property of a ListBox which is where I got that from.  </p>