+ Reply to Thread
Results 1 to 9 of 9

Create PDF for Each Sheet and Then Email Each Sheet

  1. #1
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2007
    Posts
    113

    Create PDF for Each Sheet and Then Email Each Sheet

    I have been working with various solutions out there but to no avail, and would really appreciate some help on this.

    I basically have one master workbook, that I will need to (1) breakup into smaller worksheets, (2) save each worksheet out as a PDF file, and (3) email the PDF as well.


    I have solved for the first two parts, however
    I have two disparate macros that each seem to accomplish one part of each of the tasks, but cannot get them to work together.

    So I already have:
    a) a Macro that will break a mastersheet down into smaller sheets, create PDF files with respect to each newly created sheet (based on values in some Column, A, for example), and name/save the resulting PDF files accordingly to a path of my choosing
    b) a Macro that will break a mastersheet down into smaller sheets, and email out each sheet as an Excel file <-- I need this to be a PDF file, not Excel

    Again, I'm not sure how to create a macro that will accomplish both of the above, but retain everything in PDF format (as explained in the 2nd line of my post above).


    As for the emails themselves:
    (as outlined in step b. above), the macro code I do have allows me to specify cells that will house the email addresses, for example (on each sheet, in cell J2), as well as the subject for each email, which can again be tailored to each sheet (based on some dynamic reference).
    The macro I have also allows for CC and BCC email addresses (so they could be on each sheet in cells J3 and/or J4 for example)
    I can generate these for each worksheet, but just wanted to throw this out there.


    I would really appreciate any help offered on this.
    Attached is a sample workbook if it helps.


    Thanks in advance!

    FYI:
    The macro that I'm using for Part a) above came from here: http://www.franklinharper.com/2011/0...cel-worksheet/
    The macro that I'm using for Part b) above came from here: http://www.rondebruin.nl/win/s1/outlook/amail5.htm
    Attached Files Attached Files
    Last edited by hamidxa; 12-29-2014 at 07:53 PM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Create PDF for Each Sheet and Then Email Each Sheet

    Hi hamdixa

    Attach a File, with existing Code, that shows how you get from here
    a) a Macro that will break a mastersheet down into smaller sheets, create PDF files with respect to each newly created sheet (based on values in some Column, A, for example), and name/save the resulting PDF files accordingly to a path of my choosing
    b) a Macro that will break a mastersheet down into smaller sheets, and email out each sheet as an Excel file
    and we'll show you how to get to here
    a Macro that will break a mastersheet down into smaller sheets, and email out each sheet as an Excel file <-- I need this to be a PDF file, not Excel
    John

    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.

  3. #3
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2007
    Posts
    113

    Re: Create PDF for Each Sheet and Then Email Each Sheet

    Quote Originally Posted by jaslake View Post
    Hi hamdixa

    Attach a File, with existing Code, that shows how you get from here

    and we'll show you how to get to here


    jaslake,

    Ive attached two files that I believe accomplish each of the items you were requesting to see further, although neither are specifically related to the task at hand, they should serve to demo the techniques I described earlier.

    The first file ("File_a"), demonstrates part a, it:
    breaks the master sheet, "1010version", down into several smaller sheets (based on values in Col B), names them based on a dynamic cell reference, and then saves the resulting pdf files onto the C drive
    (The macro that does most of this heavy lifting is named "ExportReg" and is tied to the button named "1" on the 1st sheet, "1010messaged"


    The second file ("File_b"), demonstrates part b), it
    has two macros, that when ran, will generate pdf files (same as above), but the second macro will actually initiate the outlook emails.
    This is tied to the macro named "Mail_Every_Worksheet" and is connected to the button "Step 2. Email" on the first sheet, "1010Messaged".
    Attached Files Attached Files

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Create PDF for Each Sheet and Then Email Each Sheet

    Hi hamdixa

    I'll need to get back to you after the Holiday weekend...have Family in. Sorry...

  5. #5
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2007
    Posts
    113

    Re: Create PDF for Each Sheet and Then Email Each Sheet

    Quote Originally Posted by jaslake View Post
    Hi hamdixa

    I'll need to get back to you after the Holiday weekend...have Family in. Sorry...
    jaslake,

    I totally understand, and thoruoughly appreciate your consideration.

    Ill try to rig something together, but Im sure it will be far from elegant or an optimal solution.

    I look forward to your response (hopefully soon ) when you have another chance to revisit this thread.


    Thanks for all that you do!

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Create PDF for Each Sheet and Then Email Each Sheet

    Hi hamdixa

    The Code in the attached appears to do as you require. As you have links that I haven't access to, for testing purposes, I've place the Email Address in Cell Q2 below the File Name. You can change that if you wish.

    The Code takes a bit of time to complete due to Page Setup and PDF Creation.

    Let me know of issues.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2007
    Posts
    113

    Re: Create PDF for Each Sheet and Then Email Each Sheet

    jaslake,

    Thank you so much for getting back to me on this sooner than expected!
    I will test this tonight and let you know.

  8. #8
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2007
    Posts
    113

    Re: Create PDF for Each Sheet and Then Email Each Sheet

    Quote Originally Posted by jaslake View Post
    Hi hamdixa

    The Code in the attached appears to do as you require. As you have links that I haven't access to, for testing purposes, I've place the Email Address in Cell Q2 below the File Name. You can change that if you wish.

    The Code takes a bit of time to complete due to Page Setup and PDF Creation.

    Let me know of issues.
    jaslake,

    This worked.
    Thanks so much for your help!

    PS. I also sent you a pm.

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Create PDF for Each Sheet and Then Email Each Sheet

    You're welcome...glad I could help. Thanks for the Rep.

+ 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. How to create individual sheets from one sheet and email them individually
    By Shoju in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-21-2013, 11:18 AM
  2. Macro to create email with refrence taken from excel sheet
    By sameeru in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-07-2013, 08:37 AM
  3. Replies: 1
    Last Post: 01-24-2013, 03:47 PM
  4. Replies: 11
    Last Post: 10-14-2012, 01:03 PM
  5. Problems creating a macro to create a single email from each row of a sheet
    By dcgrove in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2009, 03:24 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