Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

excel vba combo box

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Excel VBA Combo box

Excel VBA Combo box

ResolvedVersion 2003

Andy has attended:
Excel Advanced course
Excel VBA Intro Intermediate course

Excel VBA Combo box

Hi,

I am trying to get a list to appear in a number of list or combo boxs. the list is in a sheet called "Players Lists" and runs from cells C2 to C32.

In the second combo box I would like to have all the options in the first combo box apart from the one selected in combo box 1.

Hope that makes sense

Thanks

Andy

RE: Excel VBA Combo box

Hi Andy, thanks for your query. You could achieve this by modifying our code on the Excel VBA intro intermediate course, in which we loaded up two comboboxes from lists on a worksheet. We simply looped through a list on a worksheet and added the cell values into the combobox. However, you could add in an IF test to see whether each successive cell value was equal to the combobox.value property selected by the user and if it was to skip it, move on to the next iteration of the loop, thereby filtering out those values from the second combobox list. This sounds involved but shouldn't take any more coding than you have already achieved on the Intro Intermediate course. Have a try, and if you need any further assistance, drop me a line back and I'll post the code here.

Hope this helps,

Anthony

RE: Excel VBA Combo box

Hi Anthony,

Thanks very much - I was looking at the wrong bit of code to copy over - it works now though!

Have a nice weekend

Andy

 

Training courses

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
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Separate the year from a date

To separate the year from a date use the =year() function, eg a date is in cell A1 and in A2 you wish to display the year enter the function =year(A1)

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.