VBA excel设置打印区域
我正在使用命名范围设置一个打印区域,因为它是一个表,并且会增长。 执行时,标题不会打印。如何调整以打印命名的rangeTable3和标题 我试过了; ActiveSheet.PageSetup.PrintArea=RangeTable3{Headers}.Address 但只打印标题VBA excel设置打印区域,excel,vba,Excel,Vba,我正在使用命名范围设置一个打印区域,因为它是一个表,并且会增长。 执行时,标题不会打印。如何调整以打印命名的rangeTable3和标题 我试过了; ActiveSheet.PageSetup.PrintArea=RangeTable3{Headers}.Address 但只打印标题 Application.Dialogs(xlDialogPrinterSetup).Show Application.PrintCommunication = False With ActiveSh
Application.Dialogs(xlDialogPrinterSetup).Show
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = Range("Table3").Address
Application.PrintCommunication = False
With ActiveSheet.PageSetup
我想打印标题和表3。表是一个表格。使用该属性返回表引用的范围,包括标题
Dim myTbl as ListObject
Set myTbl = ThisWorkbook.Sheets("mysheetname").ListObjects("Table3")
...
ThisWorkbook.Sheets("mysheetname").PageSetup.PrintArea = myTbl.Range.Address
根据需要更改图纸名称。正确。我得到了表3,但没有标题。我知道当将范围命名为表3时,我选中了表示我的表有标题的框。不知道结果会怎样。