+ Reply to Thread
Results 1 to 10 of 10

Export 240 worksheets as PDF and add the correct name

  1. #1
    Registered User
    Join Date
    09-06-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    19

    Export 240 worksheets as PDF and add the correct name

    I have a file that I format and split into 240 separate worksheets, I then have to save each of those into PDF with a very specific format. For example, Tauner, Alisha, 00001018990589, 08.10.16, 03.47.46 PM, 0.39.39, Inbound


    Is there a way to export all 240 as PDF and for naming purposes reference a list of names and match a value, in this case, the long number and the name. BUT in the 240 sheets, the long number would say "Packet Ref ID: 00001018990589" and the name would be "Alisha L Tauner" so it couldn't match 100%.

    Figure that is likely a bit much, and I have a code to export as pdf, just the naming is off.



    Please Login or Register  to view this content.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Export 240 worksheets as PDF and add the correct name

    To make this the CLEAREST to us what is really needed here, can you attach some samples? What I would think would be:
    1) A workbook with only info for 3 of these worksheets
    2) The final exported PDF of these 3 sheets in the exact output and name that would like them to be.

    From that we should be able to connect the dots for you.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Re: Export 240 worksheets as PDF and add the correct name

    OK, so this is aimed at the hardest of the two approaches.

    Book 1 has four sheets. Sheet 1 is the filenames, that is the exact name it has to be. the next three sheets are what the notepads look like. So then you export each sheet separately as a PDF and name it accordingly.

    There will be 240 file names and 240 separate sheets.
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Export 240 worksheets as PDF and add the correct name

    So it will be a need for the macro to look in cell A1 of each sheet and pull out the Packet Ref ID: and find that filename on the list in sheet Filenames?

  5. #5
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Re: Export 240 worksheets as PDF and add the correct name

    Yes, I think you are on the right tract, that is a simple and concise way to put it.

    And I would like to be able to have a prompt for the destination of the PDFs, so if someone else needs to do this in the future, they do not have to adjust the code.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Export 240 worksheets as PDF and add the correct name

    This working for me. I added some filenames that did not match to any sheets and the macro is doing the correct thing, reporting the results in column B of FILENAMES.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-06-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    19

    Re: Export 240 worksheets as PDF and add the correct name

    Hey man, I think you really surpassed what I even thought possible! but out of 240 file names, only one was found and exported, but it was done perfectly! i've attached a sample with three that were not located. I adjusted the names and numbers to anonymize them. But now when I run the macro, I get an out of range error for
    Please Login or Register  to view this content.
    Sorry I am so far behind in testing and responding and I hope this finds you.
    Attached Files Attached Files

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Export 240 worksheets as PDF and add the correct name

    Hi friend, I'm in California, just starting the day. Will review this shortly.

  9. #9
    Registered User
    Join Date
    09-06-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    19

    Re: Export 240 worksheets as PDF and add the correct name

    Hey, disregard!!! It works!! it was my fault. I ran it before splitting the notepads into the 240 different sheets. Dumb early morning mistake on my part!

    Now if I can figure out why my macro that splits into 240 sheets has all of a sudden decided to not work as it had.

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Export 240 worksheets as PDF and add the correct name

    On my code blog (link is in my signature) are many tools for common tasks. Splitting one sheet to 240 sheets sound like a candidate for my SHEET1 TO MANY SHEETS, a macro for parsing rows of data from one sheet to many sheets named for the same values in a specific column.


    It not only can parse the rows, it can create the sheets if they are missing. There is a sample sheet there where you can test this out.
    Last edited by JBeaucaire; 12-26-2019 at 03:55 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. Export Specified Worksheets
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-19-2014, 01:45 PM
  2. [SOLVED] Export Specified Worksheets to PDF
    By dmarzean in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-19-2014, 03:30 AM
  3. Replies: 1
    Last Post: 10-30-2012, 06:34 PM
  4. Export worksheets
    By mjhopler in forum Excel General
    Replies: 2
    Last Post: 06-14-2010, 01:02 PM
  5. Replies: 1
    Last Post: 03-30-2005, 03:06 PM
  6. XML Export and worksheets
    By WHoit in forum Excel General
    Replies: 0
    Last Post: 03-15-2005, 07:06 PM
  7. [SOLVED] Export auto correct dictionary
    By Sakkie in forum Excel General
    Replies: 2
    Last Post: 03-11-2005, 11:06 AM

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