Consulting

Results 1 to 3 of 3

Thread: VBA 2010 create PDF from multiple sheets

  1. #1

    Unhappy VBA 2010 create PDF from multiple sheets

    Hi everyone, with the code below I can make a PDF of 1 active sheet, but how can I command the code to NOT make a PDF of the page where for example cells C9,L9,U9,AD9,E249,N249,W249,AF249,AO249 are blanc? This are specific cells on each page (VpageBreaks) of the active sheet. This was easy to ask :-) :-) . Thanks for answering!!

    [vba]
    Sub PDF()
    Thisworkbook.Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5")).Select
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    Thisworkbook.Path & "\Path\" & Range("C1").Value & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, _
    IgnorePrintAreas:=False, OpenAfterPublish:=False
    Thisworkbook.Activate
    Thisworkbook.Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5")).Deselect
    End Sub
    [vba]

    I tried to deselect again the active workbook sheets becouse that causes dangerous situations :-( although this is not working propperly :-( I should find the solution to skip the PDF of blanc worksheets. (based on cell references) this code is actually making the PDF BUT it is damaging the buttons of my active workbook!
    Last edited by Aussiebear; 05-23-2013 at 12:28 AM. Reason: Corrected the tags surrounding the code

  2. #2

    question too easy??

    no one is challeged enough??

  3. #3
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,064
    Location
    Perhaps of it is posted in the correct forum then it will be responded to.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Posting Permissions

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