98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Excel VBA : Populating a list box with a field | Excel forum
Excel VBA : Populating a list box with a field | Excel forum
Resolved · Low Priority · Version 2003
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
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Change the Default Width of All Columns in Excel 2010If you want to change the width of the columns in your Excel 2010 spreadsheet, making them either larger or smaller, here's how: |