ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Print Macro (https://www.excelbanter.com/excel-discussion-misc-queries/135729-print-macro.html)

The Rook[_2_]

Print Macro
 
I currently the following macro set up to print the active workbook. What do
I need to ad to this to exclude sheet 1?:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 21/03/2007 by me'

'
ActiveWorkbook.PrintOut Copies:=1, Collate:=True
End Sub


Dave Peterson

Print Macro
 
One way is to build a list of all the sheets to be printed.

Another way is to hide the sheet, print the remainded and then unhide the sheet.

worksheets("sheet1").visible = xlsheethidden
ActiveWorkbook.PrintOut Copies:=1, Collate:=True, Preview:=true
worksheets("sheet1").visible = xlsheetvisible


(Preview:=true is nice for testing)


The Rook wrote:

I currently the following macro set up to print the active workbook. What do
I need to ad to this to exclude sheet 1?:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 21/03/2007 by me'

'
ActiveWorkbook.PrintOut Copies:=1, Collate:=True
End Sub


--

Dave Peterson


All times are GMT +1. The time now is 10:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com