LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default before print macro not printing multiple selected worksheets

Hello, I have the following code as before print macro in a worksheet where
all the worksheets that I would print ("meta" is one I don't print) have
identical column structure & page set up (just the rows of data differ):

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Meta = "Meta"
destCell = Worksheets(Meta).Range("b43").Value
Dim WS As Worksheet
For Each WS In ActiveWindow.SelectedSheets
'MsgBox WS.Name & " ; " & WS.Range(destCell).Value
WS.PageSetup.CenterFooter = "&8data as of " _
& Format(WS.Range(destCell).Value, "yyyy-mm-dd hh:mm:ss") _
& Chr(13) & "Page &P of &N"
Next WS
End Sub

If I select just one worksheet to print, it prints with the footer data as
expected.
If I select multiple worksheets to print, this macro would go through all
the worksheets to update the footers as expected *but* after all the footers
are updated all the worksheets selected become de-selected except the first
one selected so that only the first worksheet gets printed.

Is there a way to modify the macro to make sure it will print all selected
tabs?

Thanks a lot.

 
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
Print selected worksheets in multiple workbooks? T & I Forms Excel Discussion (Misc queries) 1 April 3rd 10 11:52 PM
Print selected pages from multiple worksheets Tigerxxx Excel Discussion (Misc queries) 4 December 29th 07 06:58 PM
Printing single pages from multiple worksheets in a single print job [email protected] Excel Discussion (Misc queries) 2 April 27th 07 06:11 PM
How do I print a workbook in but only print selected worksheets? Karl S. Excel Discussion (Misc queries) 1 August 31st 06 12:34 AM
Printing Selected Worksheets B Baggins Excel Programming 3 September 7th 05 04:35 PM


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

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"