Header properties in code

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
 
D

Dave Peterson

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.
 
G

Guest

Many Thanks Dave. Code works fine. You and the other answer people never get
enough credit. Glad to have you as a resource.
Ray
 

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

Top