Help with BeforePrint Event

JoshYoung81

New Member
Joined
Dec 21, 2017
Messages
5
So here is what I am trying to do. I have a spread with several sheets that are printed on a periodic basis. What I want is when a sheet is printed is for today's date to be added to a "Print Log" tab as a record of when it was done.

Thanks,
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Welcome to the Board!

What is the structure of your "Print Log" sheet?
Are you just wanting to record the date/time, or are there other fields?
Are you only keeping track of the most recent one (meaning pasting over the previous record), or adding a new record under the last record?
 
Upvote 0
Here is a simple example that will print the date and time in column A under the last entry:
Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
    Sheets("Print Log").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0) = Now()
End Sub
 
Upvote 0
It is just a list in column A of dates. THe problem i am running into is that when i switch to that tab, it prints that tab
 
Upvote 0
THe problem i am running into is that when i switch to that tab, it prints that tab
Probably because you are selecting/activating your "Print Log" tab.
You do not need to do that. Do it like I did in my previous post.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top