Results 1 to 3 of 3

Generate PDF file on two sites

Threaded View

  1. #1
    Registered User
    Join Date
    02-12-2016
    Location
    Zurich, Switzerland
    MS-Off Ver
    MS Office 2013
    Posts
    94

    Generate PDF file on two sites

    Sub PDF()
    
       Sheets("Result").Activate
       ActiveSheet.UsedRange.Select
    
       ThisWorkbook.Sheets(Array("Result")).Select
       Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
          "C:\Users\etavernaro\Desktop\Tax_Rulings_Database.pdf", Quality:=xlQualityStandard, _
          IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
          True
          
          With ActiveSheet.PageSetup
        .PrintArea = Worksheets("Result").UsedRange
        .Orientation = xlLandscape
        .FitToPagesWide = 1
        .FitToPagesTall = 1
        .Zoom = False 'I have added this line
    End With
    
    End Sub
    Is it possible to specify that the output on PDF gets separated on to two pages? I am exporting a worksheet to a PDF but because there are so many columns the font size is very small. If I could split the output to two pages that would be fantastic.

    In advance many thanks for your help!

    I got it so far that it splits the sheet into three pages (with FitToPages) but now I would like that it ignores the entire first row of the sheet when generating the PDF.

    Sheets("Result").Range("B2:U100").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    Above I specified that it exports the range B2:U100 to the PDF. In that way it would ignore the first row (=A). The problem is, that the "Result" sheet has not always the same amount of data and therefore at times it also copies blank cells to the PDF. Is it possible to specify above code so that it ignores the first row (=A) and ONLY copies those rows to the PDF that are filled?
    Last edited by JBeaucaire; 03-03-2016 at 01:18 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How can I generate a Word file using an Excel file?
    By public in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-07-2015, 05:46 AM
  2. [SOLVED] Generate csv file from excel
    By anilbavaraju in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-25-2014, 12:27 AM
  3. [SOLVED] Need VBA Help on MS-Access to generate report & save to xlsb file to tageted file
    By breadwinner in forum Access Programming / VBA / Macros
    Replies: 6
    Last Post: 05-23-2014, 07:52 AM
  4. Dynamically Generate graph in an excel file from a .csv file [URGENT]
    By pushkarjajoria in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2013, 06:51 AM
  5. Open the last modified file from sharepoint sites
    By vigneshwaran in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-14-2012, 12:25 AM
  6. Macro to get the latest file (excel file) from sharepoint sites
    By vigneshwaran in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-13-2012, 09:45 AM
  7. Generate File Name Programatically
    By T.J. Lanza in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-19-2009, 02:11 PM

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