|
-
Dec 21st, 2003, 06:58 PM
#1
Excel - Printing inside before_print() function
Hi,
I need to print 4 copies of my worksheet, but i need to change a cell before each print, so my 4 printed sheets will have a different value in that place, only that place.
I create the macro, and copy the code, here it is:
code:--------------------------------------------------------------------------------
Sub Print_Macro()
Sheets("hoja1").Select
Range("A40").Select
ActiveCell.FormulaR1C1 = "Original"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("A40").Select
ActiveCell.FormulaR1C1 = "Duplicado"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("A40").Select
ActiveCell.FormulaR1C1 = "Triplicado"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("A40").Select
ActiveCell.FormulaR1C1 = "Cuadruplicado"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("A40").Select
ActiveCell.FormulaR1C1 = "Original"
End Sub
--------------------------------------------------------------------------------
And put this macro in the Before_Print Event of my workbook
It works fine but after print, the print window pops up, its normal because i used before_print event, but HOW CAN I REMOVE THIS WINDOW?? I mean, i dont want it to be shown.
Before_print use a parameter (Cancel as boolean) but if I set Cancel = True then nothing is printed.
Any idea?
Thanks!
Jcis
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|