I've added a box to your form where you can enter how many products out of the product list you want to be listed.
Private Sub CommandButton1_Click()
Dim iListCount As Integer, iColCount As Integer
Dim iRow As Integer, r As Long
Dim Products, i As Long, p As Long
r = 11
Set Products = Range("Products")
If TextBox1.Value <> "" Then
p = TextBox1.Value + 0
Else
p = Products.Cells.Count
End If
For iListCount = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(iListCount) = True Then
ListBox1.Selected(iListCount) = False
iRow = iRow + 1
For iColCount = 0 To Range("Entities").Columns.Count - 1
Range("A" & r).Value = ListBox1.List(iListCount, iColCount)
For i = 1 To p
Range("B" & r + i - 1) = Products(i - 1)
Next i
r = Range("B" & Rows.Count).End(xlUp).Row + 1
Next iColCount
End If
Next iListCount
Columns("B").AutoFit
End Sub
Bookmarks