我在Excel中有一个打印输出按钮,它分配给以下代码:
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Sheets(Array("Cover", "1", "1-1", "2", "3", "4")).PrintOut , , 1
Sheet1.PrintOut , , 1 'use this method to print all together at the end instead printing individually.
Application.ScreenUpdating = True
End Sub但是,它不打印工作表,而是从打印100个随机页面开始,每页打印3-10个值(这没有什么实际意义)。打印范围是在所有工作表上设置和检查的,我真的不知道错误是从哪里来的。
有什么想法吗?
首先谢谢你!
发布于 2015-10-30 19:51:08
您仍然可以以这种方式使用PrintOut:
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
'If you want only to print the active sheet
Sheet1.PrintOut
'Printing a range, from the first page until page 23, one copy:
Sheet1.PrintOut 1,23,1
'Printing only a single page (23), two copies:
Sheet1.PrintOut 23,23,2
Application.ScreenUpdating = True
End Sub看一看:https://msdn.microsoft.com/en-us/library/office/ff838253.aspx
https://stackoverflow.com/questions/11438649
复制相似问题