PDA

View Full Version : After print event



Nec11
04-29-2013, 05:15 AM
Hello to all!

It is any possibility to fins an "AfterPrint" event enabler.

The problem is that I have an excel table with "Sheet1" where I insert some values, and on "Sheet2" an Pivot table. After printing the pivot table I need to save the eralier inserted dates in "Sheet3" to keep hisory of movements.

The problem is that I have managed to select "Sheet1"/copy"Sheet1"/paste to "Sheet3" via an VBA liked to an Button.
I need to do this via VBA code.

Any ideea?
Thank you in advance

Ringhal
04-29-2013, 05:30 AM
I haven't tested this, but this might be what you can use.

Excel VBA does not have an after print event, but use this workaround to call a function after the print event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Application.OnTime Now, "AfterPrint"
End Sub

Private Sub AfterPrint()
'code to run after the print event goes here
End sub
The afterprint function is called after the print event occurred. Make sure to add the AfterPrint() in a module

Nec11
04-29-2013, 07:53 AM
Tested, but seams to do not work...

Pradeep N
07-15-2022, 07:17 AM
Thanks man that works

snb
07-15-2022, 07:44 AM
Even after 9 years .......