Help with Header

G

Guest

I have the following code that puts the date value that I want into the
header of all worksheets.

Sub DateInHeader2()
Dim S As Worksheet
For Each S In ActiveWorkbook.Worksheets
S.PageSetup.LeftHeader = Format(Sheets("SUMMARY").Range("C1").Text, _
"[$-409]mmmm d, yyyy;@")
Next
End Sub

Now I need to be to able format the text to bold. Below is a sample that I
recorded to format the header to bold but I can not figure out how to
incorpate this info into the above code.

..LeftHeader = "&""Arial,Bold""January 1, 2004"

Please help
 
G

Guest

Hi
not tested but try:
..PageSetup.LeftHeader = "&""Arial,Bold""" & Format(Sheets("SUMMARY").Range
_("C1").Text, "[$-409]mmmm d, yyyy;@")
 
T

Tom Ogilvy

Sub DateInHeader2()
Dim S As Worksheet
For Each S In ActiveWorkbook.Worksheets
S.PageSetup.LeftHeader = "&""Arial,Bold""" & _
Format(Sheets("SUMMARY").Range("C1").Text, _
"[$-409]mmmm d, yyyy;@")
Next
End Sub

--
Regards,
Tom Ogilvy

Judd Jones said:
I have the following code that puts the date value that I want into the
header of all worksheets.

Sub DateInHeader2()
Dim S As Worksheet
For Each S In ActiveWorkbook.Worksheets
S.PageSetup.LeftHeader =
Format(Sheets("SUMMARY").Range("C1").Text, _
"[$-409]mmmm d, yyyy;@")
Next
End Sub

Now I need to be to able format the text to bold. Below is a sample that I
recorded to format the header to bold but I can not figure out how to
incorpate this info into the above code.

.LeftHeader = "&""Arial,Bold""January 1, 2004"

Please help
 

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