I am trying to create a macro that backups data from a document to a csv file, but my main objective is to only backup data from the sheet that is being printed.
So, in my understanding, the way to do this is by attaching a macro to the "onprint" event, getting which sheet is being printed, then running some code.
On these 3 steps, I can't figure it out step 2: "get which sheet is being printed". I would like to, as the user goes through printing options on normal interface and sets which sheets and pages he wants to print, then set it to print, I want to grab these selected options as input to a macro.
I tried something like this attached to "onprint" event:
Code: Select all
Sub Main(Event As Object)
...
End Sub
Does anyone know if it is possible?
Hope I made it understantable.
Thank you in advance
Mateus