VBA script that saves excel range as pdf

做~自己de王妃 提交于 2019-12-03 07:48:36

问题


I tried implimenting a range into my code, but I'm having no luck. I'd like to be able to have a script in vba to 'save as' a specific sheet or specific range to pdf. Any help would be much appreciated.

Here is what I've been working with:

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    "c:\Book1.pdf", Quality:= _
    xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
    OpenAfterPublish:=True

Thanks,


回答1:


you have the code, just use a range instead of activesheet

e.g. Sheets("Sheet1").Range("B2:H28").ExportAsFixedFormat ...



来源:https://stackoverflow.com/questions/13073888/vba-script-that-saves-excel-range-as-pdf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!