+ Reply to Thread
Results 1 to 5 of 5

Using USERFORM to collect variables and choose appropriate macro

  1. #1
    Registered User
    Join Date
    03-13-2010
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Exclamation Using USERFORM to collect variables and choose appropriate macro

    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!

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Using USERFORM to collect variables and choose appropriate macro

    The attached has a userform with 3 option buttons, with captions "ReportType1", "ReportType2" and "ReportType3".
    There are also two checkboxes named, cbxPrint and cbxPDF
    as well as buttons, butOK and butCancel.

    in the userform's code module
    Please Login or Register  to view this content.
    in a normal module
    Please Login or Register  to view this content.
    Attached Files Attached Files
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Using USERFORM to collect variables and choose appropriate macro

    Please proved a link to your cross-post on a different forum.

    Waiting before cross posting is appreciated, but going back and linking to the new cross posting prevents duplicate effort.

  4. #4
    Registered User
    Join Date
    03-13-2010
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Smile Re: Using USERFORM to collect variables and choose appropriate macro

    Thanks so much for the help mikerickson. I replied to you on the other forum, but I will say the same here. Your feedback made me run out and get MrExcel's 'vba and macro for excel 2007' the very same day. I'm trying hard to learn this as fast as humanly possible.

    I will be more mindful with cross-posting. Kinda new to the whole forum scene.

    Thanks again!

  5. #5
    Registered User
    Join Date
    03-13-2010
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Using USERFORM to collect variables and choose appropriate macro

    Also, what can you (or other members) recommend as the 'best' resource for learning VBA for excel in the business/accounting realm? I'm half way through my book already. I just finished university, so going through large books and taking notes is my specialty

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1