Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default print no shading on selected sheets

The following macro negates shading for printing.
But it only works for one sheet.
If I select more than one page, it only works on the last page.

How can I get this to work for all selected pages, either contigous or
non-contiguous?
*** A loop doesn't work, it throws the page numbering off, and has other
issues.
Thanx,
- Mike

ActiveSheet.PageSetup.BlackAndWhite = True
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.BlackAndWhite = False
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default print no shading on selected sheets

for each sh in ActiveWindow.SelectedSheets
sh.PageSetup.BlackAndWhite = True
Next
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
for each sh in ActiveWindow.SelectedSheets
sh.PageSetup.BlackAndWhite = False
Next

--
Regards,
Tom Ogilvy


"MikeF" wrote:

The following macro negates shading for printing.
But it only works for one sheet.
If I select more than one page, it only works on the last page.

How can I get this to work for all selected pages, either contigous or
non-contiguous?
*** A loop doesn't work, it throws the page numbering off, and has other
issues.
Thanx,
- Mike

ActiveSheet.PageSetup.BlackAndWhite = True
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.BlackAndWhite = False

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default print no shading on selected sheets

Thanx Tom.
Since print jobs are sent sometimes to a paper printer and other times to
pdf, is there any chance of including "choose printer", as well as print
preview, in this code?
Again, much appreciated.
- Mike

"Tom Ogilvy" wrote:

for each sh in ActiveWindow.SelectedSheets
sh.PageSetup.BlackAndWhite = True
Next
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
for each sh in ActiveWindow.SelectedSheets
sh.PageSetup.BlackAndWhite = False
Next

--
Regards,
Tom Ogilvy


"MikeF" wrote:

The following macro negates shading for printing.
But it only works for one sheet.
If I select more than one page, it only works on the last page.

How can I get this to work for all selected pages, either contigous or
non-contiguous?
*** A loop doesn't work, it throws the page numbering off, and has other
issues.
Thanx,
- Mike

ActiveSheet.PageSetup.BlackAndWhite = True
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.BlackAndWhite = False

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default print no shading on selected sheets

Why not just pop the print dialog and let the user decide... something like
this...

for each sh in ActiveWindow.SelectedSheets
sh.PageSetup.BlackAndWhite = True
Next
Application.Dialogs(xlDialogPrint).Show
for each sh in ActiveWindow.SelectedSheets
sh.PageSetup.BlackAndWhite = False
Next

--
HTH...

Jim Thomlinson


"MikeF" wrote:

Thanx Tom.
Since print jobs are sent sometimes to a paper printer and other times to
pdf, is there any chance of including "choose printer", as well as print
preview, in this code?
Again, much appreciated.
- Mike

"Tom Ogilvy" wrote:

for each sh in ActiveWindow.SelectedSheets
sh.PageSetup.BlackAndWhite = True
Next
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
for each sh in ActiveWindow.SelectedSheets
sh.PageSetup.BlackAndWhite = False
Next

--
Regards,
Tom Ogilvy


"MikeF" wrote:

The following macro negates shading for printing.
But it only works for one sheet.
If I select more than one page, it only works on the last page.

How can I get this to work for all selected pages, either contigous or
non-contiguous?
*** A loop doesn't work, it throws the page numbering off, and has other
issues.
Thanx,
- Mike

ActiveSheet.PageSetup.BlackAndWhite = True
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.BlackAndWhite = False

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default print no shading on selected sheets


You probably want to use one of these:

application.Dialogs(xlDialogPrinterSetup).Show

or

application.Dialogs(xlDialogPrint).Show

--
Regards,
Tom Ogilvy



"MikeF" wrote:

Thanx Tom.
Since print jobs are sent sometimes to a paper printer and other times to
pdf, is there any chance of including "choose printer", as well as print
preview, in this code?
Again, much appreciated.
- Mike

"Tom Ogilvy" wrote:

for each sh in ActiveWindow.SelectedSheets
sh.PageSetup.BlackAndWhite = True
Next
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
for each sh in ActiveWindow.SelectedSheets
sh.PageSetup.BlackAndWhite = False
Next

--
Regards,
Tom Ogilvy


"MikeF" wrote:

The following macro negates shading for printing.
But it only works for one sheet.
If I select more than one page, it only works on the last page.

How can I get this to work for all selected pages, either contigous or
non-contiguous?
*** A loop doesn't work, it throws the page numbering off, and has other
issues.
Thanx,
- Mike

ActiveSheet.PageSetup.BlackAndWhite = True
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.BlackAndWhite = False

Reply
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 a selected number of sheets RobN[_3_] Excel Discussion (Misc queries) 9 June 8th 07 12:28 PM
How to print a selected number of sheets? Rafat Excel Worksheet Functions 0 June 9th 06 02:50 PM
Print selected sheets in Excel M H Excel Programming 0 January 4th 05 05:18 PM
Print selected sheets in Excel M H Excel Programming 0 January 4th 05 04:48 PM
Print selected sheets in Excel M H Excel Programming 0 January 4th 05 03:37 AM


All times are GMT +1. The time now is 07:27 AM.

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

About Us

"It's about Microsoft Excel"