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

advanced excel courses - userforms

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » advanced excel courses - Userforms

advanced excel courses - Userforms

ResolvedVersion 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:

Move data worksheet to worksheet

To move data from one worksheet to another, highlight the data.

Select and hold down the ALT key and position the mouse on the border of the selection until the mouse pointer displays four-headed arrows.

Drag the selection down to the destination worksheet tab.

When the arrow touches the tab, Excel switches to the desired worksheet. Now drag the selection to the correct position. Let go of the mouse and then the ALT key.

To copy data from one worksheet to another, select and hold down the CTRL+ALT keystroke combination and perform the steps above.

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.