VideoPhoto

Showing posts with label event-driven. Show all posts
Showing posts with label event-driven. Show all posts

25 October, 2021

Header/Footer: What can be entered there?

Excel offers the following built-in headers and footers. They can be added to your worksheet easily, with a single mouse click.

However, we're not limited to these options. In fact, you can enter any text/string into your worksheet cell and add it to any part of the header or footer with just one line of VBA code of a macro. E.g., this line will add contents of cell B2 to the left part of a header:

ActiveSheet.PageSetup.LeftHeader=Range("B2").Value

Such a line can be included in the VBA code I'm presenting at the bottom of this post.