Excel - 将多个工作表导出为PDF [英] Excel - export multiple sheets as a PDF

查看:127
本文介绍了Excel - 将多个工作表导出为PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Excel中创建了2张。然后,我使用下面的VBA将2张纸导出为PDF

I created 2 sheets in Excel. Then, I used the VBA below to export the 2 sheets as a PDF

Sub Macro1()
   Sheets("Sheet_1").Activate
    ActiveSheet.UsedRange.Select
   Sheets("Sheet_2").Activate
   ActiveSheet.UsedRange.Select

   ThisWorkbook.Sheets(Array("Sheet_1", "Sheet_2")).Select
   Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
      "C:\Temp\MyPDF.pdf", Quality:=xlQualityStandard, _
      IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
      True
End Sub



但导出的PDF包含4页,其中第2页和第4页是实际上是空的如何通过消除空页面将其格式化为2页?谢谢。



我的尝试:



Excel - 导出多个工作表作为PDF - 如何消除空页


But the exported PDF contains 4 pages, of which Pages 2 and 4 are actually empty. How can I format it as 2 pages only with the elimination of the empty pages? Thanks.

What I have tried:

Excel - Export multiple sheets as a PDF - How to eliminate the empty pages

推荐答案

您的工作表右侧或底部有一些单元格,但不显示空白,因此包含这些单元格在你想要打印的内容中。

键入Ctrl-End转到最后一个单元格,你会看到它比你预期的要大。

你要么删除那些单元格,要么为每张纸定义打印区域。
Your sheets have some cells in right or bottom that display nothing but are not empty, so these cells are included in what you want to print.
Type Ctrl-End to go to last cell, you will see it is bigger than you expect.
Either you remove those cells, either you define the print zone for each sheets.


这篇关于Excel - 将多个工作表导出为PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆