98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » advanced excel courses - Userforms
advanced excel courses - Userforms
Resolved · 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.
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...
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
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Select only cell that contain text to lock formatFor selecting cells that only contain Text in Excel |