Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Header properties in code
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Header properties in code
Many Thanks Dave. Code works fine. You and the other answer people never get
enough credit. Glad to have you as a resource. Ray "Dave Peterson" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
printing 'title' from properties in header | Excel Discussion (Misc queries) | |||
properties in header | Excel Discussion (Misc queries) | |||
How can I using Excel custom document properties in the header? | Excel Worksheet Functions | |||
Document Properties in Header or Footer | Excel Discussion (Misc queries) | |||
Printing the page properties as header | Excel Discussion (Misc queries) |