title: loop through several listbox vba
body: <p>I have the following code, off course it is not working, but I hope it suggests my intentions.</p>
  
  <pre><code>Dim lItem As Long
  Dim input_sh As Worksheet
  Dim lb As ListBox
  Set input_sh = ActiveWorkbook.Sheets("Input")
      For i = 1 To 4
          lb = "ListBox" &amp; i
          For lItem = 0 To lb.ListCount - 1
              If lb.Selected(lItem) = True Then
                  input_sh.Cells(1, 14 + i) = lb.List(lItem)
                  lb.Selected(lItem) = False
              End If
          Next lItem
      Next i
  </code></pre>
  
  <p>Basically I have 4 listbox in an userform and would to use a for loop to get the selected items, instead of having a for loop for each listbox.</p>