• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA to print file with print area name

Hi,

I've below code written to print data in excel basis print area. I need assistance in amending the same, so that excel picks up print area as file name whenever I try to print it to PDF in excel.

Please assist.

>>> use code - tags <<<
Code:
Sub Print_PL_Summary()
    With ActiveSheet.PageSetup
        .FitToPagesWide = 1
        .FitToPagesTall = 2
        .FirstPageNumber = counter
        .PrintArea = "print_summary"
    End With
    '<VBA_INSPECTOR>
    '   <CHANGE>
    '       <MESSAGE>Potentially contains changed items in the object model</MESSAGE>
    '       <ITEM>[xls]Sheets.PrintOut</ITEM>
    '       <URL>http://go.microsoft.com/fwlink/?LinkID=215357 </URL>
    '   </CHANGE>
    '</VBA_INSPECTOR>
    ActiveWindow.SelectedSheets.PrintOut Copies:=1
    counter = counter + 2
End Sub
 
Last edited by a moderator:
Back
Top