Friday, February 3, 2017

Multiple Listbox Additem From worksheeet Excell VBA

VBA Code

Private Sub UserForm_Initialize()
Dim i As Long
For i = 1 To Application.WorksheetFunction.CountA(Sheet1.Range("A:C"))
For x = 1 To 3
Me("listbox" & x).AddItem Sheet1.Cells(i, x).Value
Me("listbox" & x).Selected(0) = True
Next x
Next i
End Sub

No comments:

Post a Comment

Please do not enter any spam message in comment box