Jul 22 2019 07:36 AM
I would like to use the content of cell A1, for example, as the recurring data in the worksheet's header. Can #Excel do this?
Jul 22 2019 09:19 AM - edited Jul 22 2019 09:39 AM
Hi,
You cannot reference a cell in the Header section (Say by typing =C5) that will not grab the value. However there is a tricky way to resolve this issue by recording a simple Macro and trigger it before printing.
Here is a Tutorial that covers exactly that issue:
https://www.youtube.com/watch?time_continue=117&v=SMdV7Pz6kg0
if you do not want to watch the Tutorial then do the following:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim Sh As Worksheet
For Each Sh In Me.Worksheets
Sh.PageSetup.CenterHeader = Sh.Range("C5").Value
Next Sh
End Sub
You can replace CenterHeader by LeftHeader or RightHeader
replace C5 by any cell of your choice
On the Other hand , in the Page Setup dialog box (Shortcut is ALT, P, S, P) >> Header Tab >> Custom Header >> You have some icons to include predefined functionality such as Date, Time, File Name, Sheet Nam ...etc
Hope that helps you
If you like my answer please mark it as an accepted one.
Nabil Mourad
Jul 22 2019 09:42 AM
Thank you for the information on the macro option. I look forward to reviewing and using this option.