advanced excel courses - userforms

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 » advanced excel courses - Userforms

advanced excel courses - Userforms

resolvedResolved · Low Priority · Version Standard

Jennifer has attended:
Excel VBA Intro Intermediate course

Userforms

I am trying to set up a macro with user input, where they can choose one of several options (countries), each country chosen is then used as a variable in the macro (ie. country1, country2 etc). I have set up a checklist on a userform, but I'm not sure how to transfer the checked options to the main macro from the form.

Edited on Mon 26 Nov 2007, 13:16

RE: userforms

Hi Jeniffer

The simplest way to do it is to create Public variables in the macro to receive the values from the form.

You could create the variables as an Array eg.

Public Country(5) as Variant .

This will hold 6 values. Now when the countries are selected in the form their names are place in the Array.

Attached is an excel sheet that shows some check boxes that when clicked will add a country name to the array.

Hope it helps

Carlos

Attached files...

Use Country Form.xls

 

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:

Select only cell that contain text to lock format

For selecting cells that only contain Text in Excel

By selecting cells that only contain text, you can delete, fill or protect cells of this type.

Use short cut to Go to box (F5) or Edit, Go to
In the dialog box, click special button & select Constants and only check text or any other desired type.

Click OK.

And text cells will all be highlighted for you to apply format. Please note only works on one sheet at a time.

View all Excel hints and tips


Server loaded in 0.08 secs.