+ Reply to Thread
Results 1 to 4 of 4

Print PDF based on UserForm input

  1. #1
    Registered User
    Join Date
    01-08-2019
    Location
    München
    MS-Off Ver
    365
    Posts
    8

    Print PDF based on UserForm input

    Hi folks,
    I want to build a PDF print out function that considers the user's input into a userform.
    Basically I got 2 worksheets (CW and Year), each containing 10 charts, with each chart on one page (in terms of print area).

    Now I want the user to be able to chose the charts to be printed, either as individual files or all together in one PDF.

    This is, how the UserForm looks like:
    RwxOE.png

    If the user choses to save the charts as individual PDFs, she should be prompted only once for the location to save the PDFs to. The tabs on the form "CW" and "Year" are basically the same, but only refer to 2 different worksheets. The tab "Filter" only contains a single choice.

    I tried creating an array (charts vs. pages) with charts correspond to the CheckBoxes. So if chart "Units, Performance, KPI and Region South" are selected, it'll look like ({1,1}, {0,2}, {1,3}, {1,4}, {0,5}, {0,6}, {0,7}, {1,8}, {0,9}, {0,10}) - never mind the format - with {#,..} being true or false, depending on the user's choice, and {..,#} being the corresponding page number of the charts.
    However, with that approach I'm running into 2 problems: a) reseizing the array to all true values being equal to ({1,1}, {1,3}, {1,4}, {1,8}). That would tell, which pages to print. And, problem b) is that the command
    Please Login or Register  to view this content.
    only allows to input a page range (
    Please Login or Register  to view this content.
    ) but not the individual pages.

    What's your idea on solving this issue? Any best practicess or another work around?
    Thanks for your effort in advance!

  2. #2
    Registered User
    Join Date
    01-08-2019
    Location
    München
    MS-Off Ver
    365
    Posts
    8

    Re: Print PDF based on UserForm input

    No one with any idea?

  3. #3
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,384

    Re: Print PDF based on UserForm input

    Welcome to the forum!

    Simple questions will get the quickest response. Some don't answer posts if there are multiple with multiple questions that are not simply solved. Also, there are several things unknown about your file. Attaching a short example file, often helps the respondents more quickly respond with on-target solutions.

    I am guessing that If I did it, I would first name the charts so that the userform controls easily know that. That can be by a sequential suffix naming convention or, add the chart name to Tag property for your checkbox controls.

    For the all charts to one pdf problem part, the macro would copy the charts to a scratch workbook with likely one chart per worksheet. That is if order matters.

    Since I almost always test solutions before posting, it will take me some time to work up a sample of what you might have and then work on a solution.

  4. #4
    Registered User
    Join Date
    01-08-2019
    Location
    München
    MS-Off Ver
    365
    Posts
    8

    Re: Print PDF based on UserForm input

    Dear Kenneth,
    thanks for your reply! I wasn't able to attache the relevant file since it contains confidential data. Anyways, the idea to copy the selected charts into a temporary file will probably do the trick. I'll give it a try and will get back to you asa. Thanks once again.

+ 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