Herman has attended:
Excel VBA Intro Intermediate course
Excel VBA : Populating a list box with a field
Hello,
How would I create a list box that would populate the list of HR people in a user forum list box?
Thanks
Herman
RE: Excel VBA : Populating a list box with a field
Hello Herman
Thank you for your question.
The first thing to do would be to type the names of the HR people into a list somewhere within your workbook.
You would then need to write some code that loops through the list, one row at a time; and at each point adds the name in that row to the list box.
The key piece of code that adds the item to the list box would take the form.
Count = ActiveCell.CurrentRegion.Rows.Count
With Me.listbox
For Counter = 2 To Count
.AddItem Worksheets("worksheet name").Cells(Counter, 1)
Next Counter
End With
Hope this is useful
Regards
Stephen