titles at top of each page

Copper Contributor

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

3 Replies

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.

print-different-titles.png

 

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.

@M_Hesen I suppose by each page, you mean each sheet and as a title you mean title as the one on the picture below (Weekly Sales & Bonus Payout). Is that correct?

 

Screenshot 2020-01-05 at 22.04.00.png 

 

If this is the case, you could simply just reference this title to the desired cell(s).

Let me know if this helps.

 

Best,

Branka

@Branka BraduleI want to VIEW titles at the top of each page when browsing a spreadsheet.