【问题标题】:VBA print line number and column letter in pdf documentVBA在pdf文档中打印行号和culumn字母
【发布时间】:2023-01-17 19:30:19
【问题描述】:

所以我正在尝试打印 excel 表。 到目前为止,我已经设置了大部分内容,但我无法获得行号或列字母。

我尝试了很多东西,例如 LineNumbering、PrintTitleColumns,但我认为这不是我真正想要的。

这是我的代码:

Sub PrintToPDF()
' Saves active sheet as PDF file.
Dim Name As String
Dim wkPrint As Worksheet

FileNameArray = Split(ThisWorkbook.Name, ".")
Name = ThisWorkbook.Path & "\" & Format(Now(), "yyyy-mm-dd") & "_" & FileNameArray(0) & ".pdf"

Set wkPrint = ThisWorkbook.Worksheets("Dokumentation")

'On Error GoTo err
'wkPrint.PrintCommunication = True

With wkPrint.PageSetup
    .PaperSize = xlPaperA3
    .RightHeader = "&D &T"
    .PrintGridlines = True
    '.LineNumbering.Active = True
    '.PrintTitleColumns = "A:AA"
End With

'Application.PrintCommunication = True

wkPrint.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Name, _
    Quality:=xlQualityStandard, IncludeDocProperties:=True, _
    IgnorePrintAreas:=False, OpenAfterPublish:=False
Exit Sub
'err:
'MsgBox err.Description
End Sub

提前致谢!

【问题讨论】:

    标签: excel vba page-setup


    【解决方案1】:

    你在找wkPrint.PageSetup.PrintHeadings = True

    【讨论】:

      猜你喜欢
      • 2020-06-10
      • 1970-01-01
      • 2016-10-09
      • 2015-01-14
      • 1970-01-01
      • 2018-11-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多