将Excel范围另存为pdf

问题描述 投票:7回答:1

我想将另存为特定工作表或特定范围的数据另存为pdf。

我尝试在我的代码中实现范围。

这是我一直在使用的内容:

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
  "c:\Book1.pdf", Quality:= _
  xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
  OpenAfterPublish:=True
excel vba pdf save-as
1个回答
17
投票

您有代码,只需使用范围而不是activesheet

例如Sheets("Sheet1").Range("B2:H28").ExportAsFixedFormat ...

© www.soinside.com 2019 - 2024. All rights reserved.