Forum Discussion
M_Hesen
Jan 04, 2020Copper Contributor
titles at top of each page
excel 365 - is there a way to have a different title on each page where the data for the title field comes from a field on that page - thank you for any help
Alan_Murray
Jan 05, 2020MVP
This is possible M_Hesen with Excel VBA. Do you have some experience here?
There is a BeforePrint event so when somebody prints we can have the macro run and use a cell value from the sheet/page in the header.
Open the Visual Basic Edit with the Alt + F11 keyboard shortcut.
Double click ThisWorkbook for the file
Select Workbook and BeforePrint from the two drop down lists
Enter the following code shown in the image.
Then when you print, you can print just one sheet, or change the print the entire workbook and each sheet will use the info from cell A1 in the header.
I have also attached a working example.