Formulas in the header?

  • Thread starter Thread starter SandyB
  • Start date Start date
S

SandyB

We want to put the worksheet title (from cell A1) into the
header automatically...any way to do that?
Formulas aren't working...
Inserting fields doesn't work...

Anything else I can try?

Thanks!
 
Put this in your ThisWorkbook code module (right-click on the
workbook title bar and choose View Code):

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ActiveWindow.SelectedSheets
With wkSht
.PageSetup.LeftHeader = .Range("A1").Value
End With
Next wkSht
End Sub

you can substitute RightHeader or CenterHeader for LeftHeader.
 
Ive just tried this for my own Header.

Is it possible somehow to also set the font and size so that it can
match the settings I have for my Footer (which is set the same for
every page).

Many Thanks

eddie
 
Is it possible somehow to also set the font and size so that it ca
match the settings I have for my Footer (which is set the same fo
every page).

Many Thanks

eddi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top