+ 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,573

    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)

Similar Threads

  1. [SOLVED] Setting print area based on input
    By QAChaska in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-03-2013, 01:37 PM
  2. Print Rows Based on Input
    By pkew22 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2013, 12:02 PM
  3. Replies: 0
    Last Post: 06-17-2013, 07:25 PM
  4. Replies: 4
    Last Post: 11-28-2012, 06:09 PM
  5. Calculation based on input from userform textbox
    By h0ps in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-21-2012, 10:41 PM
  6. Creating n number of worksheets based on userform input
    By abousetta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-06-2010, 12:50 PM
  7. Writing a Formula based on UserForm input
    By MichelleW in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-06-2009, 11:15 AM
  8. Print certain data based upon input box
    By Coal Miner in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-19-2006, 01:50 PM

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