Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() -- For den, der kun kender en hammer, komme alle problemer hurtigt til at ligne søm. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
And this was empty :-(
Anyway I need som code to change interior colors before print, and reset them after. I have tried something like this on the Before_Print Event Range("A1").Interior.ColorIndex = xlNone ActiveWindow.SelectedSheets.PrintOut Copies:=1 Range("A1").Interior.ColorIndex = 6 The problem is, that the sheet is printed twice, onece without the background color, and once with it. If I add Cancel = True, nothing is printed at all. Jan |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet Application.EnableEvents = False Range("A1").Interior.ColorIndex = xlNone ActiveWindow.SelectedSheets.PrintOut Copies:=1 Range("A1").Interior.ColorIndex = 6 Cancel = True Application.EnableEvents = True End With End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Jan Kronsell" wrote in message ... And this was empty :-( Anyway I need som code to change interior colors before print, and reset them after. I have tried something like this on the Before_Print Event Range("A1").Interior.ColorIndex = xlNone ActiveWindow.SelectedSheets.PrintOut Copies:=1 Range("A1").Interior.ColorIndex = 6 The problem is, that the sheet is printed twice, onece without the background color, and once with it. If I add Cancel = True, nothing is printed at all. Jan |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you very much.
Jan Bob Phillips wrote: Private Sub Workbook_BeforePrint(Cancel As Boolean) With ActiveSheet Application.EnableEvents = False Range("A1").Interior.ColorIndex = xlNone ActiveWindow.SelectedSheets.PrintOut Copies:=1 Range("A1").Interior.ColorIndex = 6 Cancel = True Application.EnableEvents = True End With End Sub "Jan Kronsell" wrote in message ... And this was empty :-( Anyway I need som code to change interior colors before print, and reset them after. I have tried something like this on the Before_Print Event Range("A1").Interior.ColorIndex = xlNone ActiveWindow.SelectedSheets.PrintOut Copies:=1 Range("A1").Interior.ColorIndex = 6 The problem is, that the sheet is printed twice, onece without the background color, and once with it. If I add Cancel = True, nothing is printed at all. Jan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
apply cell change event to single column - WorksheetChange Event | Excel Programming | |||
Before_Print | Excel Programming | |||
before_print does not work - f8 key does not do anything | Excel Programming | |||
Before_Print | Excel Programming | |||
Re-Post: Before_Print Sub Doesn't Trigger | Excel Programming |