+ Reply to Thread
Results 1 to 6 of 6

VBA Code to create a single PDF from multiple worksheets

  1. #1
    Registered User
    Join Date
    10-18-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    8

    VBA Code to create a single PDF from multiple worksheets

    Hi Guys,

    I'm pretty new here, but I have already found some great macros, but I need a bit of help with this one.

    I need a macro to create a single PDF based on the print area of 5 different worksheets. I want the filename to be a cell in another sheet (Eg A1 in a sheet called 'Set"), and I also want to be able to save it to a directory eg C:\PDF

    Any help would be appreciated.

    Below is a macro I found and have tried to manipulate to make it do what I want it to do....but without any success so far...it gets stuck on the 'nname' line.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: VBA Code to create a single PDF from multiple worksheets

    try this
    Please Login or Register  to view this content.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  3. #3
    Registered User
    Join Date
    10-18-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: VBA Code to create a single PDF from multiple worksheets

    Hi John,

    That works great.....how can I specify the path to save it into? It currently saves to my desktop.

    Preferably I would like it to save to a Sharepoint Library such as https://portal.xxxxxxx.com/xx/xxxxxxx/ManagementReports - or better still utilise the Office sharepoint saving function where it allows you to specify metadata. But if I could at least specify a location on my computer that would be great.

    Thanks
    Last edited by chris.tinta; 10-18-2012 at 02:27 AM.

  4. #4
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: VBA Code to create a single PDF from multiple worksheets

    maybe this
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-18-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: VBA Code to create a single PDF from multiple worksheets

    Cool.....one more thing.
    Can I reference the path to a cell in my 'Setup' sheet...eg B8 rather than hard referencing it in the macro?

    Thanks, this has been a great help!!

  6. #6
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: VBA Code to create a single PDF from multiple worksheets

    try this
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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