+ Reply to Thread
Results 1 to 2 of 2

Output many output of one worksheet in to 1 file pdf

  1. #1
    Registered User
    Join Date
    03-07-2020
    Location
    Italy
    MS-Off Ver
    Office 2007
    Posts
    12

    Output many output of one worksheet in to 1 file pdf

    Hello !
    How can I save a print area with various
    processing step in a single PDF file?

    Example

    Worksheets("example1").PageSetup.PrintArea = "A1:A6"

    For T = 1 to 6
    Range ("A3"). Value = range ("A1") * t
    ' -----------------------------------------
    'create PDF page from excel print area
    ' -----------------------------------------
    next
    '---------------------------------
    'save PDF file (1 file - 6 pages)
    ' ---------------------------------


    This Code

    ActiveSheet.ExportAsFixedFormat _
    Type: = xlTypePDF, Filename: = _
    NomeFile, Quality: = xlQualityStandard, _
    IncludeDocProperties: = True, _
    IgnorePrintAreas: = False, OpenAfterPublish: = True

    create only one PDF file, but for the single worksheet.

    The pages are not created.

    Sorry for my English!

    I don't want to print 6 PDF files in a PDF printer to get 1 single file

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Output many output of one worksheet in to 1 file pdf

    There are two methods.

    1. Create each worksheet as a pdf file and then use a 3rd party application to merge all pdfs. The last part can be in your code after the pdf file creation code. One uses Shell() and passes the inputs to the application. I have used pdf24 for things like that where I created a multi-tif file. Obviously, pdfs are its thing so merging pdfs with it or similar applications is easy.

    2. Macro would create a scratch workbook and copy the sheet however many times needed. It would then make your changes or make change before the copy. An array of sheet names in that workbook would then merge all of those worksheets into one pdf. After job is done, the scratch workbook is closed and not saved.

    I use (2) when I want to make a multi-page pdf but want a specific page/worksheet order. This is because the array of worksheet names method exports in worksheet index order rather than array element index order.

    Here is method (2) without the scratch workbook.
    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)

Similar Threads

  1. Compare values and output cell titles, able to output multiple results
    By TMG2016 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-07-2016, 11:42 AM
  2. [SOLVED] Array to embed formula and if number of output is met output Blank
    By ywang in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-29-2015, 02:34 AM
  3. [SOLVED] Cell reference, output dates to numeric. Should output as text
    By lifeseeker1019 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-02-2015, 05:51 PM
  4. [SOLVED] Comparing two cells for similarities and output a third cell (if C1 = B1, then output A1)
    By PERFECT777 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-26-2013, 12:37 AM
  5. [SOLVED] Paste variable output (SQL Output) into a single cell.
    By fblaze in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2013, 06:24 AM
  6. Looping through columns to copy output into other sheet, and saving output
    By eludlow in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-08-2009, 06:27 AM
  7. Importing several Output sheets into one consolidated Output Sheet
    By Ugh_Der in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-13-2009, 08:58 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