Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
printing 'title' from properties in header Sbone Excel Discussion (Misc queries) 0 December 3rd 08 10:41 PM
properties in header IMFletch Excel Discussion (Misc queries) 1 January 4th 07 09:07 PM
How can I using Excel custom document properties in the header? ecalvo Excel Worksheet Functions 4 November 3rd 05 09:29 PM
Document Properties in Header or Footer Rohullah Najafi Excel Discussion (Misc queries) 1 January 6th 05 02:59 PM
Printing the page properties as header r_najafi Excel Discussion (Misc queries) 1 January 6th 05 02:59 PM


All times are GMT +1. The time now is 12:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"