Header properties in code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have modified some code written by Chip Pearson. The code works perfectly.
Basically the code takes the content of a cell and places it in the header. I
need to add additional code to bold the header. I am calling the sub with the
Workbook_BeforePrint event.
Sub PrintHeader()
ActiveSheet.PageSetup.CenterHeader = _
"Action Item List" & " " & vbCrLf & Format(Worksheets("Action
List").Range("A2").Value)
End Sub

TIA
 
I recorded a macro when I bolded a header and got this:

..CenterHeader = "&""Arial,Bold""asdf"

If you want Arial Bold, then maybe:

.CenterHeader = "&""Arial,Bold""Action Item List" _
& " " & vbCrLf & _
Format(Worksheets("Action List").Range("A2").Value)

If you want a different font, I'd record the macro when I did it manually.
 
Many Thanks Dave. Code works fine. You and the other answer people never get
enough credit. Glad to have you as a resource.
Ray
 
Back
Top