从 Excelsheet 中以横向格式导出 PDF,不留空白 space
Export PDF from Excelsheet in Landscape format without blank space
需要解决我的痛苦。以下代码有效,但问题是它将空白 space 显示为完整站点。我想知道是否可以 "shrink" 那个?
收缩应该从@列开始"F"
这是代码:
Private Sub CommandButton1_Click()
Dim mySheets As Variant, sh
mySheets = Array("Tabelle1")
For Each sh In mySheets
Sheets(sh).PageSetup.Orientation = xlLandscape
Next
Range("A1:CR33").Select
Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ThisWorkbook.Path & "\export.pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End If
End Sub
这里的插图是图片。
这就是我得到的:http://www.bilder-upload.eu/show.php?file=e31421-1438765650.jpg
这就是我想要的:http://www.bilder-upload.eu/show.php?file=a9f566-1438765707.jpg
谢谢
我想这就是你想要的:
私人订阅 CommandButton1_Click()
将 mySheets 调暗为变体,sh
mySheets = Array("Tabelle1")
For Each sh In mySheets
Sheets(sh).PageSetup.Orientation = xlLandscape
Next
For Each the_cell In Range("A1:A33")
If the_cell.Value = "" Then
the_cell.EntireRow.Hidden = True
Else
Exit For
End If
Next the_cell
Range("A1:CR33").Select
Selection.ExportAsFixedFormat Type:=xlTypePDF, fileName:=ThisWorkbook.Path & "\export.pdf", _
quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
Range("A1:A33").EntireRow.Hidden = False
End Sub
基本上,我添加了一个循环 - 它将隐藏第一个填充行之前的单元格(并在之后取消隐藏)
希望这对您有用
需要解决我的痛苦。以下代码有效,但问题是它将空白 space 显示为完整站点。我想知道是否可以 "shrink" 那个?
收缩应该从@列开始"F"
这是代码:
Private Sub CommandButton1_Click()
Dim mySheets As Variant, sh
mySheets = Array("Tabelle1")
For Each sh In mySheets
Sheets(sh).PageSetup.Orientation = xlLandscape
Next
Range("A1:CR33").Select
Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ThisWorkbook.Path & "\export.pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End If
End Sub
这里的插图是图片。 这就是我得到的:http://www.bilder-upload.eu/show.php?file=e31421-1438765650.jpg
这就是我想要的:http://www.bilder-upload.eu/show.php?file=a9f566-1438765707.jpg
谢谢
我想这就是你想要的:
私人订阅 CommandButton1_Click() 将 mySheets 调暗为变体,sh
mySheets = Array("Tabelle1")
For Each sh In mySheets
Sheets(sh).PageSetup.Orientation = xlLandscape
Next
For Each the_cell In Range("A1:A33")
If the_cell.Value = "" Then
the_cell.EntireRow.Hidden = True
Else
Exit For
End If
Next the_cell
Range("A1:CR33").Select
Selection.ExportAsFixedFormat Type:=xlTypePDF, fileName:=ThisWorkbook.Path & "\export.pdf", _
quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
Range("A1:A33").EntireRow.Hidden = False
End Sub
基本上,我添加了一个循环 - 它将隐藏第一个填充行之前的单元格(并在之后取消隐藏)
希望这对您有用