Excel VBA BeforePrint Issue

Not all Print Previews are Equal

Excel has a BeforePrint event which enables you run VBA code before a document is printed. This event can also be triggered by Print Preview. But not all Print Previews are the same.

The main use of the BeforePrint event is to set up the headers and footers for a print. You can link parts of the header and footer to a cell with this technique.

You usually test it by using Print Preview because that also triggers the BeforePrint event and stops you wasting paper.

Something I found out recently is that using the Print Preview in the File tab DOESN’T trigger the BeforePrint event.

I use the Print Preview Full Screen option (old school) see blog post here on how to add it to your Quick Access Toolbar – this triggers the BeforePrint event and can be used for testing and saving paper.

Please note: I reserve the right to delete comments that are offensive or off-topic.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.