+ Reply to Thread
Results 1 to 11 of 11

Mass Create PDF Loop

  1. #1
    Registered User
    Join Date
    09-23-2018
    Location
    Nebraska
    MS-Off Ver
    excel 2016
    Posts
    6

    Mass Create PDF Loop

    Hi Everyone,

    Here is what I am hoping to accomplish. Currently I have a print macro within VBA that will formulate names from a named range “listAthlete” in a listbox and allow me to print a sheet for each athlete chosen. I would like to have the same or similar set up, but instead of printing the sheet, I would like excel to create a PDF version named after the person(s), and save the copies in a folder. Any help would be greatly appreciated! Attached is a excel copy with some dummy data.
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Mass Create PDF Loop

    All you need to do is export the worksheet as pdf

    Please Login or Register  to view this content.

    Just create the worksheet the way you want it and set it up as you would want it printed.
    Then incode the code.

    The syntax is if you want to expoer the active sheet

    Save2PDF whichSheet:=ActiveSheet

    Happy coding
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    09-23-2018
    Location
    Nebraska
    MS-Off Ver
    excel 2016
    Posts
    6

    Re: Mass Create PDF Loop

    Hi Keebellah,

    I'm sorry my excel knowledge is pretty remedial. What do you mean by syntax? Here is what I tried with the information you gave me: I created another command button within the FrmPrintWizard Form, then copy pasted the code you suggest. I had no success there. I also tried going into module1 and copy pasting the information you had. I also had no luck there. I am sure I'm missing the boat somewhere.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Mass Create PDF Loop

    You see, if you attach a file with macros and say that you have a print macro that does this and that, you give the reader (us in this case) the idea that you know something about what you're doing.
    Don't do that, just say I copied a macro and blah blah and also mention that your knowledge of VBA is not up-to-date, it's okay to say that we all started from zero, the only way to learn is byt trial-and-error and a lot's of time
    I'll pick it up and see if I can implement it for you

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Mass Create PDF Loop

    Okay, this my idea, I added an option button to the print form, default it is true (activated) when you print, I also added the question if you want to print , that is something you should always do, it is waht you call 'USER FRIENDLY'

    I've attached the file and it works, one output included

    Hope this helps

  6. #6
    Registered User
    Join Date
    09-23-2018
    Location
    Nebraska
    MS-Off Ver
    excel 2016
    Posts
    6

    Re: Mass Create PDF Loop

    Keebellah,

    I opened your version and tried it out. I like the option button, but I can't get it to toggle of. It always seems to stay selected on. Also when I then run the names to PDF save, I only get one copy saved for the last athlete chosen instead of all of the desired ones. Lastly, how can I change the name of the PDF file to be the same of the athlete(s)? I apologize for all of the questions, but I do appreciate all of your help.

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Mass Create PDF Loop

    Sorry my mistake, should be a checkbox, changed it
    Attached Files Attached Files

  8. #8
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Mass Create PDF Loop

    I overlooked your last one about the file names, will do it in a moment

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Mass Create PDF Loop

    Modified it not tested on all but should do it.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    09-23-2018
    Location
    Nebraska
    MS-Off Ver
    excel 2016
    Posts
    6

    Re: Mass Create PDF Loop

    Great! Everything seems to work. Thank you very much for taking time to help me out.

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Mass Create PDF Loop

    Glad it worked
    VBA is really quite simple, just take the time

+ 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] Mass create storage locations using specified format
    By glomb175 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-13-2017, 12:27 PM
  2. Replies: 1
    Last Post: 07-22-2016, 03:00 PM
  3. create a for loop within a for loop
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-02-2015, 02:28 PM
  4. [SOLVED] I want to create loop with a loop
    By wolfdemon710 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-28-2015, 03:33 PM
  5. Mass Create Multiple Graphs from data on different tab
    By evoganski in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 03-07-2013, 12:52 PM
  6. how do i create form of yes/no answers for mass e-mail sending
    By dato in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-20-2006, 09:15 AM
  7. How do I create a For loop within a For loop?
    By Linking to specific cells in p in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-24-2005, 06:07 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