View Single Post
Old 05-11-2011, 12:38 PM
OTPM OTPM is offline Windows 7 32bit Office 2010 32bit
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road

Please see a post below made by Tom Urtis a few years ago which may give you what you want.

Headers and footers are left, center, and right. Yes, they can be underlined. To do it, use the U& syntax. Here is an example of formatting the left header with the workbook name, the center header with some special manual notation, and the right header custom formatted for date and time.

With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,regular""&U" & ThisWorkbook.Name
.CenterHeader = "&""Arial,regular""&U" & "Budget sheet 1 of 10"
.RightHeader = "&""Arial,regular""&U" & "Printed on " & Format(Now(), "mm/dd/yy, at hh:mm:ss")
End With

Regarding having the line stretch all the way across, one possible code line modification to do that would be to add spaces between quote marks, as in this example for the left header:

.LeftHeader = "&""Arial,regular""&U" & ThisWorkbook.Name & " "

You'd need to play around with it but that'd be the gist.
Tom Urtis
Reply With Quote