如何在“打印”选项卡中设置“适用于一页上的所有列”

时间:2022-05-03 20:24:14

The only thing I would want is to always set the 'Fit all columns on one page' setting when users open the Print tab in Excel.

我唯一想要做的就是在用户打开Excel中的Print选项卡时,始终设置“在一个页面上安装所有列”。

And no, they don't want to do it themselves. What a surprise :)

不,他们不想自己做。一个惊喜:)

Here is a screenshot of where that is in Excel 2013:如何在“打印”选项卡中设置“适用于一页上的所有列”

以下是Excel 2013中的截图:

Tried to look for some VBA code like the following but without success.

尝试查找如下所示的VBA代码,但没有成功。

With Sheets("Print Letter").PageSetup .FitToPagesWide = 1 .FitToPagesTall = 1 End With

与表(“打印信”)。pagestup .FitToPagesWide = 1 .FitToPagesTall = 1结尾

1 个解决方案

#1


19  

Try setting the .FitToPagesTall to False to be able to manually set the .FitToPagesWide property.

尝试将. fittopagestall设置为False,以便能够手动设置. fittopageswide属性。

MSDN link

MSDN链接

If this property is False, Microsoft Excel scales the worksheet according to the FitToPagesWide property. If the Zoom property is True, the FitToPagesTall property is ignored.

如果此属性为False,则Microsoft Excel根据FitToPagesWide属性扩展工作表。如果Zoom属性为真,则会忽略FitToPagesTall属性。

Sub PrintColumns()
    Application.PrintCommunication = False
    With Sheets("Print Letter").PageSetup
        .FitToPagesWide = 1
        .FitToPagesTall = False
    End With
    Application.PrintCommunication = True
End Sub

#1


19  

Try setting the .FitToPagesTall to False to be able to manually set the .FitToPagesWide property.

尝试将. fittopagestall设置为False,以便能够手动设置. fittopageswide属性。

MSDN link

MSDN链接

If this property is False, Microsoft Excel scales the worksheet according to the FitToPagesWide property. If the Zoom property is True, the FitToPagesTall property is ignored.

如果此属性为False,则Microsoft Excel根据FitToPagesWide属性扩展工作表。如果Zoom属性为真,则会忽略FitToPagesTall属性。

Sub PrintColumns()
    Application.PrintCommunication = False
    With Sheets("Print Letter").PageSetup
        .FitToPagesWide = 1
        .FitToPagesTall = False
    End With
    Application.PrintCommunication = True
End Sub