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 » Adding variable names to List Box
Adding variable names to List Box
Resolved · Low Priority · Version 2003
Brian has attended:
Excel VBA Intro Intermediate course
Adding variable names to List Box
Hi Mark,
I was wondering if you were able to provide code on how to add variable names into a combobox.
Example - List of data with peoples names.
I want to loop through the code and add only unique names to the combobox.
Thanks
Brian
RE: Adding variable names to List Box
Hi Brian
Thanks for your question
I have written some code to solve your problem. I have uploaded an example workbook with the code. I have annotated that code so hopefully it will be reasonably clear. I suggest running through it line by line in break mode.
Simply the procedure cycles through the list. At the first row it writes that value into an array. It then checks to see if the contents of each subsequent row is already in the array. If it isn't then that value is written to the array.
The contents of the array are then written into the combo box
If you have any queries please feel free to repost your question
Regards
Stephen
Attached files...
Tue 22 Mar 2011: Automatically marked as resolved.
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:No ZerosWant all the zeros in your worksheet to appear blank? Choose Tools/Options, Click on the View Tab, Deselect the Zero Values Option, Click OK. |