Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Header properties in code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ray A - 19 Jan 2006 20:18 GMT
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 - 19 Jan 2006 21:54 GMT
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.

> Hi,
> I have modified some code written by Chip Pearson. The code works perfectly.
[quoted text clipped - 8 lines]
>
> TIA

Signature

Dave Peterson

Ray A - 19 Jan 2006 23:02 GMT
Many Thanks Dave. Code works fine. You and the other answer people never get
enough credit. Glad to have you as a resource.
Ray

> I recorded a macro when I bolded a header and got this:
>
[quoted text clipped - 20 lines]
> >
> > TIA
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.