+ Reply to Thread
Results 1 to 4 of 4

VBA - saving specific pages to PDF via Checkbox selection

  1. #1
    Registered User
    Join Date
    05-25-2016
    Location
    Dublin, Ireland
    MS-Off Ver
    2010
    Posts
    2

    VBA - saving specific pages to PDF via Checkbox selection

    Hi Guys,

    Long time lurker first time poster! Apologies if I screw anything up!

    I currently have a 7 page Excel document. The first page is a cover page and, for examples sake, covers rows 1-10. The second page covers rows 11-20, 3rd page is rows 21-30 and so on until page 7. I have 6 ActiveX control checkboxes which are individually linked to the rows covering each page. so, when a checkbox is selected it un-hides the rows of that specific page.

    For example, if no checkboxes are selected only rows 1-10 will be visible (rows 11-70 will be hidden). If check box 1 is selected rows 1-10 (coverpage) and rows 11-20 will be visible.

    Here's what i'm needing some help on! Is it possible to create a VBA which creates a Pdf from only the pages which are visible? ie. if the user selected checkboxes 1,3,5 the PDF will have 4 pages: The cover page, the page from row 11-20, 31-40 and 51-60. Currently my VBA extracts all cells (despite being hidden) leaving me with blank pages in my PDF!

    Any and all advice would be greatly appreciated!

  2. #2
    Registered User
    Join Date
    05-19-2016
    Location
    London
    MS-Off Ver
    2007
    Posts
    26

    Re: VBA - saving specific pages to PDF via Checkbox selection

    hello
    try this
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-25-2016
    Location
    Dublin, Ireland
    MS-Off Ver
    2010
    Posts
    2

    Re: VBA - saving specific pages to PDF via Checkbox selection

    Hi LokLuk,

    thanks for your reply - got me started with getting this sorted! I've made a few alterations to your code and it currently stands like this:

    Please Login or Register  to view this content.
    This saves the pdf with the file name referencing cell G3.

    However, i'm still in need of some help! The entire 7 pages covers rows 1-172 which i have set in the zone impression. When i select, for example, check box 1, 3, 6 the corresponding rows are un-hidden and the user will be viewing page 1,2,4 and 7. When i then use the VBA above, it creates the full 7 page doc - filling in the visible pages with blank ones! Is there any way which i can change the A1:N172 to be dynamic, ie. only the pages which are visible to the user will be saved to pdf? do i need a variable print area linked to the checkboxes? can you create a pdf from different ranges on an excel doc?

    Thanks again for all your help!

  4. #4
    Registered User
    Join Date
    05-19-2016
    Location
    London
    MS-Off Ver
    2007
    Posts
    26

    Re: VBA - saving specific pages to PDF via Checkbox selection

    Hello
    try this :
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

    please for author questions do it in a new post, i will be absent for long time
    Attached Files Attached Files
    Last edited by LOKLUK; 05-26-2016 at 06:08 PM.

+ 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. Need vba code to print specific pages or all pages in a multipage UserForm
    By Pimp_mentality in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-24-2020, 08:13 PM
  2. Saving checkbox change
    By Rob K in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2015, 11:02 AM
  3. [SOLVED] Saving CheckBox choices????
    By eptownie1988 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-09-2014, 09:02 PM
  4. [SOLVED] Corrupt Checkbox After Saving
    By mattman123 in forum Excel General
    Replies: 3
    Last Post: 07-30-2013, 03:38 PM
  5. [SOLVED] Print Macro to email PDFs of specific pages of a workbook to specific recipients
    By mike_vr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-26-2012, 12:34 PM
  6. Saving only selected pages to PDF
    By matt1020 in forum Excel General
    Replies: 2
    Last Post: 11-10-2012, 09:27 AM
  7. [SOLVED] Saving Workbooks to web pages
    By Layne in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-18-2006, 11:15 AM

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