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