View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Header properties in code

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.

Ray A wrote:

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


--

Dave Peterson