Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Clearing shading before printing

Is there a way to clear all cell shading or even a
selection of cells when the user prints a spreadsheet? I
would like to have this connected to the user printing
the document. Also, is there a way to place the shading
back after the document prints? Thanks. Matt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Clearing shading before printing

You can use this event for this

This example will change the backround color of Range("A1:A10") from red to
nothing and print the sheet.
After printing it will place the red shading back

This example will only work for Sheet1
You can press the printbutton on the menubar


Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "Sheet1" Then
Cancel = True
Application.EnableEvents = False
Application.ScreenUpdating = False
With ActiveSheet
.Range("A1:A10").Interior.ColorIndex = xlNone
.PrintOut
.Range("A1:A10").Interior.ColorIndex = 3 'red
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub




--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Matt" wrote in message ...
Is there a way to clear all cell shading or even a
selection of cells when the user prints a spreadsheet? I
would like to have this connected to the user printing
the document. Also, is there a way to place the shading
back after the document prints? Thanks. Matt



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Clearing shading before printing

You must copy this event in the Thisworkbook module

Right click on the Excel icon next to File in the menubar
And choose View code

You are now in the Thisworkbook module
Paste the Event in this place
Alt-Q to go back to Excel


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Ron de Bruin" wrote in message ...
You can use this event for this

This example will change the backround color of Range("A1:A10") from red to
nothing and print the sheet.
After printing it will place the red shading back

This example will only work for Sheet1
You can press the printbutton on the menubar


Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "Sheet1" Then
Cancel = True
Application.EnableEvents = False
Application.ScreenUpdating = False
With ActiveSheet
.Range("A1:A10").Interior.ColorIndex = xlNone
.PrintOut
.Range("A1:A10").Interior.ColorIndex = 3 'red
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub




--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Matt" wrote in message ...
Is there a way to clear all cell shading or even a
selection of cells when the user prints a spreadsheet? I
would like to have this connected to the user printing
the document. Also, is there a way to place the shading
back after the document prints? Thanks. Matt





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Clearing shading before printing

You can include in the PageSetup line the code

With ActiveSheet.PageSetup
.BlackAndWhite = True
End with

That will cause the printing to disregard any cell shadings, but the
shadings remain on the screen after printing.

"Matt" wrote in message ...
Is there a way to clear all cell shading or even a
selection of cells when the user prints a spreadsheet? I
would like to have this connected to the user printing
the document. Also, is there a way to place the shading
back after the document prints? Thanks. Matt

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
Shading in cells is not printing....HELP! aquams Excel Worksheet Functions 1 May 12th 10 03:21 PM
Is there a non-printing shading? JGreg7 Excel Discussion (Misc queries) 1 February 24th 10 10:12 PM
Suppress printing of row shading Bob Arnett Excel Discussion (Misc queries) 1 April 15th 08 08:48 PM
Cell Shading Not Printing Laurie Excel Discussion (Misc queries) 0 August 18th 06 06:19 PM
How can I unblock the printing of cell shading? TechGuy Excel Discussion (Misc queries) 1 February 4th 05 04:56 PM


All times are GMT +1. The time now is 12:44 PM.

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"