ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macros for Printing multiple workbooks (https://www.excelbanter.com/excel-programming/368306-macros-printing-multiple-workbooks.html)

leavitttown

Macros for Printing multiple workbooks
 

Is there a way to write a macro that will print out multiple workbooks
contained in a common folder without having to open up each workbook
individually?

Thanks in advance.


--
leavitttown
------------------------------------------------------------------------
leavitttown's Profile: http://www.excelforum.com/member.php...o&userid=36765
View this thread: http://www.excelforum.com/showthread...hreadid=564823


Tom Ogilvy

Macros for Printing multiple workbooks
 
Have a macro open them for you:

Sub Printbooks()
Dim sName as String, bk as Workbook
sname = dir("C:\Myfolder\*.xls")
do while sName < ""
set bk = workbooks.Open("C:\Myfolder\" & sName)
bk.Printout
bk.close Savechanges:=True
sName = dir
Loop
End sub

--
Regards,
Tom Ogilvy

"leavitttown" wrote:


Is there a way to write a macro that will print out multiple workbooks
contained in a common folder without having to open up each workbook
individually?

Thanks in advance.


--
leavitttown
------------------------------------------------------------------------
leavitttown's Profile: http://www.excelforum.com/member.php...o&userid=36765
View this thread: http://www.excelforum.com/showthread...hreadid=564823



leavitttown[_2_]

Macros for Printing multiple workbooks
 

Thanks for the reply. This should work

--
leavitttow
-----------------------------------------------------------------------
leavitttown's Profile: http://www.excelforum.com/member.php...fo&userid=3676
View this thread: http://www.excelforum.com/showthread.php?threadid=56482



All times are GMT +1. The time now is 03:22 PM.

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