LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Printing certain pages

The easiest error checking would be:

Private Sub PrintWIPButton_Click()
Dim bReplace As Boolean
Dim SheetNum As Integer
bReplace = True
For SheetNum = 1 To Worksheets.Count

If Sheets(SheetNum).Name Like "WIP*" Then
Sheets(SheetNum).Select bReplace
bReplace = False
End If

Next SheetNum
if not bReplace then
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End if
Worksheets(1).Select

End Sub

bReplace will be false if at least one sheet has been selected in the loop
(at least one sheet starts with WIP).

--
Regards,
Tom Ogilvy


"Nick Shinkins" wrote in message
...
Thanks for all your replies!

I think I will use Tom's method combined with Ron's error checking in case
there are no sheets with WIP (which is unlikely in the context).

I guess it will be quicker not to flood the printer with individual

requests
for each page and avoiding arrays (which I thought would be the only

possible
way) is preferable.

I'm never quite sure why you dedicate so much of your time to helping

others
but it is invaluable when the books and help files just don't seem to

cover
your problem.

Thanks again guys!

Nick Shinkins



 
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
Excel 2003 printing problem--printing 1 document on 2 pages Bons Excel Discussion (Misc queries) 0 December 24th 09 04:15 PM
How do I delete pages in Excel? Keeps printing blank pages at end. Jojobean Charts and Charting in Excel 1 May 31st 07 07:37 AM
Printing Odd or Even Pages NAVEEN Excel Discussion (Misc queries) 3 February 21st 06 10:59 AM
Printing to various pages Jerry Excel Discussion (Misc queries) 1 January 6th 05 01:35 AM


All times are GMT +1. The time now is 08:58 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"