LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default MACRO TO COUNT ALL OPEN WORKBOOKS and print

Hi

Here's a way

Sub aaa()
For Each wb In Application.Workbooks
wb.Sheets("Sheet1").PrintOut
wb.Close savechanges:=True 'Or false
counter = counter + 1
Next
msg = MsgBox(counter & " sheets has been printed", vbInformation + vbOKOnly)
End Sub

Regards,
Per

"JOSEPH WEBER" skrev i meddelelsen
...
I need to know if there is a way i can run a macro to count all open
workbooks and print "sheet1" of all open workbooks. The macro should close
each workbook after printing the first sheet.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel2007; workbooks.count is not counting all open workbooks greg.campeau Excel Programming 2 August 2nd 08 08:37 PM
Count open workbooks before closing Les Excel Programming 2 June 25th 07 05:11 AM
Open many workbooks in Excel & print one page Darla Excel Discussion (Misc queries) 5 May 23rd 06 07:14 PM
Macro to open print window and set to print entire workbook retseort Excel Discussion (Misc queries) 1 October 27th 05 11:00 PM
count number of workbooks open Ronaldo Excel Programming 2 April 21st 05 01:00 PM


All times are GMT +1. The time now is 09:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"