adding variable names list
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Adding variable names to List Box

Adding variable names to List Box

resolvedResolved · Low Priority · Version 2003

replyReply Thu 10 Mar 2011, 15:03Delegate Brian said...

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

For upcoming training course dates see: Pricing & availability

replyReply Tue 15 Mar 2011, 12:18Trainer Stephen said...

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...

Forum Answer.xls

Tue 22 Mar 2011: Automatically marked as resolved.

 

Please browse our web site to find out more about
excel training uk and other Microsoft training courses.

Excel tip:

Charts

Select the data and press the function key F11 and the chart will be created on a separate worksheet.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard


Please tell us/web development about this error (copy and paste into an e-mail):
MySQL error: Duplicate entry '1' for key 'PRIMARY'
Line: 76
Actual SQL Query: insert into best_activevisitors (activevisitors_ID, activevisitors_IP, activevisitors_Time, activevisitors_Url) values (1, "38.107.179.242", now(), "/cms/forum.php")
Reported by: function sqlQueryBest()
When viewing (PHP_SELF): /cms/forum.php
Query string from URL: fpost_id=28750