Using Userform to collect variables and choose a macro

Excel_VBA_Beginner

New Member
Joined
Mar 13, 2010
Messages
2
Hi Everyone,

I have researched the site, and I am still trying to figure out how to use VBA to accomplish the 'vision' that I have. The knowledge that I've gained from the board has enabled me to code some of my program, but there are certainly a couple of major holes. Nevertheless, thanks to everyone who has contributed! I'm fairly new to VBA programming, so please excuse the 'basic' questions.

Here is a flowchart of what I have in mind:

Start a UserForm:
After the user loads raw data into a worksheet (named "RawData"), a 'Generate' button is clicked to begin the following process. (Completed)

UserForm collects 2 variables:
A userform pops up and asks for two variables based on the following:
Type of Report: 3 types - based on radio buttons (Not Completed)
Method of Output: Print or Create PDF (Not Completed)

Based on the above two variables, run two macros:
Create 1 of the 3 reports specified by the radio buttons (Macro created, but do not know how to link)
Prepare either the 'print preview' screen or the PDF based on the drop-down menu for the report generated (Macro created, but do not know how to link)

Your input on my coding would be much appreciated. Any other suggestions or helpful hints are certainly welcome. I just realized that VBA and Excel automation are certainly useful in the accounting/finance field. Your help would make all the difference!

Thank you in advance!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
You are nearly there. In the VBA editor with your form visible, double click on the radiobutton of your choice. This will open the code window for the form, with the cursor inserted in a ready macro that will be run if the user clicks on the button. Insert your code in this sub
 
Upvote 0
Thanks for the feedback sijpie. And thank you VERY much mikerickson for your help at excelforum. I seriously appreciate that. Sorry that I cross-posted. I didnt know that people venture from board to board, and I also didnt realize that people as helpful as you exist. Your code made me run out to chapters to buy the 'vba and macros for excel 2007' by mrexcel, so I'm figuring out what the coding means as we speak. I'll be more mindful next time when posting.

Cheers!
 
Upvote 0

Forum statistics

Threads
1,215,212
Messages
6,123,656
Members
449,114
Latest member
aides

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top