ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using named range value during Workbook_BeforePrint event (https://www.excelbanter.com/excel-programming/374973-using-named-range-value-during-workbook_beforeprint-event.html)

Barb Reinhardt

Using named range value during Workbook_BeforePrint event
 
I have the following procedu

Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = _
"&""Arial,Bold""&12 NNN TITLE&""Arial,Regular""&10" _
& Chr(10) & "Last date saved: " &
Format(ThisWorkbook.BuiltinDocumentProperties("las t save time").Value,
"dd-mmm-yyyy")
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = "" & Chr(10) & "&P of &N"
.RightFooter = ""
End With
End Sub

I'd like to add the range name "TEST" in where it has NNN in the
..CenterHeader. What do I need to change?

Thanks

Bob Phillips

Using named range value during Workbook_BeforePrint event
 
.CenterHeader = _
"&""Arial,Bold""&12 " Range("TEST").Value & "
TITLE&""Arial,Regular""&10" & _
Chr(10) & "Last date saved: " & _
Format(ThisWorkbook.BuiltinDocumentProperties("las t save
time").Value, "dd-mmm-yyyy")


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Barb Reinhardt" wrote in message
...
I have the following procedu

Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = _
"&""Arial,Bold""&12 NNN TITLE&""Arial,Regular""&10" _
& Chr(10) & "Last date saved: " &
Format(ThisWorkbook.BuiltinDocumentProperties("las t save time").Value,
"dd-mmm-yyyy")
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = "" & Chr(10) & "&P of &N"
.RightFooter = ""
End With
End Sub

I'd like to add the range name "TEST" in where it has NNN in the
.CenterHeader. What do I need to change?

Thanks





All times are GMT +1. The time now is 10:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com