vba 将 Excel 范围另存为 pdf
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13073888/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Save Excel range as pdf
提问by cheapkid1
I'd like to 'save as' a specific sheet or specific range to pdf.
我想将特定工作表或特定范围“另存为”到 pdf。
I tried implementing a range into my code.
我尝试在我的代码中实现一个范围。
Here is what I've been working with:
这是我一直在使用的:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"c:\Book1.pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
回答by SeanC
you have the code, just use a range instead of activesheet
你有代码,只需使用一个范围而不是 activesheet
e.g. Sheets("Sheet1").Range("B2:H28").ExportAsFixedFormat ...
例如 Sheets("Sheet1").Range("B2:H28").ExportAsFixedFormat ...