Consulting

Results 1 to 3 of 3

Thread: VBA: Export Certain sheets of a workbook as PDFs

  1. #1
    VBAX Newbie
    Joined
    Jul 2014
    Posts
    5
    Location

    VBA: Export Certain sheets of a workbook as PDFs

    I want to export the second, third, and sixth worksheets of a workbook of mine as PDFs. I can't figure out how to do it for these specific sheets without distorting the PDF.

  2. #2
    VBAX Mentor
    Joined
    Jul 2012
    Posts
    398
    Location
    Sub exportToPdfsomeSheetsTo1pdf() ' tutti i fogli in un unico documento
    Sheets(Array("name1", "name2","name3")).Select
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
        "C:\Users\user\Desktop\NewBook.pdf", Quality:=xlQualityStandard, _
        IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
        True
    Sheets(1).Select
    End Sub

  3. #3
    VBAX Newbie
    Joined
    Jul 2014
    Posts
    5
    Location
    That works to perfection, thanks a ton!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •