ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   printing multiple workbooks. (https://www.excelbanter.com/excel-worksheet-functions/21366-printing-multiple-workbooks.html)

masagua4u

printing multiple workbooks.
 
Is there a way to write a macro to print multiple worksheets and have each
workbook stapled separately. I am new to this so please help.

John Mansfield

You could try something set up similar to that below. The first routine
(PrintMultipleWorkbooks) opens a workbook. It then calls on the second
routine (Print_Sheets) to print it. Once printed, the first workbook is
closed and the second workbook is opened. The same process repeats.

Sub PrintMultipleWorkbooks()
Application.ScreenUpdating = False
Workbooks.Open Filename:="C:\WB_1.xls"
Call Print_Sheets
ActiveWorkbook.Close
Workbooks.Open Filename:="C:\WB_2.xls"
Call Print_Sheets
ActiveWorkbook.Close
Application.ScreenUpdating = True
End Sub

Sub Print_Sheets()
Dim sht
For Each sht In Sheets
If sht.Visible Then sht.Select Replace:=False
Next
ActiveWindow.SelectedSheets.PrintOut copies:=1
ActiveSheet.Select
End Sub

----
Regards,
John Mansfield
http://www.pdbook.com

"masagua4u" wrote:

Is there a way to write a macro to print multiple worksheets and have each
workbook stapled separately. I am new to this so please help.



All times are GMT +1. The time now is 02:58 AM.

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