combo boxes default

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

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Combo boxes - default option or message

Combo boxes - default option or message

resolvedResolved · Low Priority · Version 2007

Tim has attended:
Excel VBA Intro Intermediate course

Combo boxes - default option or message

When I'm using a Combo Box on a form (i.e. a drop down menu), is there a way of setting one of the options as the default?

I want the user to suggest from three options (say, Option 1, Option 2, and Option 3), and when the form first initializes I would like the option selected to automaticelly be Option 1 (which the user can then change if they wish). Thank you!

RE: Combo boxes - default option or message

Hi Tim

Sorry for the delay.

To make a value in the ComboBox default to the first name you write the following line of code :

cboMyOptions.ListIndex =0

This places the first name on the list in the ComboBox window

Hope this helps:

Carlos

Thu 16 Apr 2009: Automatically marked as resolved.

 

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:

Outlining - Grouping rows or columns

Highlight want you want to group and press ALT + SHIFT + left cursor arrow

View all Excel hints and tips


Server loaded in 0.08 secs.