如何在打印选项卡中设置“在一个页面上设置所有列” [英] How to set 'Fit all columns on one page' in print tab

查看:415
本文介绍了如何在打印选项卡中设置“在一个页面上设置所有列”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只有当用户在Excel中打开打印选项卡时,才需要设置将所有列设置为一个页面设置。

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.

不,他们不想自己做。什么惊喜:)

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

以下是Excel 2013中的截图:

Here is a screenshot of where that is in Excel 2013:

试图寻找一些像以下但尚未成功的VBA代码。

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

With Sheets(Print Letter)。PageSetup
.FitToPagesWide = 1
.FitToPagesTall = 1
结束与

推荐答案

尝试设置 .FitToPagesTall to False 可以手动设置 .FitToPagesWide 属性。

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

MSDN链接


如果此属性为False,Microsoft Excel将根据FitToPagesWide属性。如果缩放属性为
True,则会忽略FitToPagesTall属性。

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.



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

这篇关于如何在打印选项卡中设置“在一个页面上设置所有列”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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