ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ActiveSheet header including a named range (https://www.excelbanter.com/excel-programming/375080-activesheet-header-including-named-range.html)

Barb Reinhardt

ActiveSheet header including a named range
 
I've had difficulty posting this so am not if it's been posted. If this is a
duplicate, please accept my apologies.

I have the following worksheet_beforeprint event

Sub Workbook_BeforePrint(Cancel As Boolean)
Application.ScreenUpdating = False
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = _
"&""Arial,Bold""&12 TEST: &""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
Application.ScreenUpdating = True
End Sub

For the CENTER HEADER, I want to display the named range PROGRAM prior to
the value TEST. How do I do this?

Thanks in advance

Ron de Bruin

ActiveSheet header including a named range
 

Do you want this Barb

.CenterHeader = _
"&""Arial,Bold""&12" & Range("PROGRAM").Value & " Test:" & _
"&""Arial,Regular""&10" & Chr(10) & "Last date saved: " & _
Format(ThisWorkbook.BuiltinDocumentProperties("las t save time").Value, "dd-mmm-yyyy")

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Barb Reinhardt" wrote in message
...
I've had difficulty posting this so am not if it's been posted. If this is a
duplicate, please accept my apologies.

I have the following worksheet_beforeprint event

Sub Workbook_BeforePrint(Cancel As Boolean)
Application.ScreenUpdating = False
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = _
"&""Arial,Bold""&12 TEST: &""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
Application.ScreenUpdating = True
End Sub

For the CENTER HEADER, I want to display the named range PROGRAM prior to
the value TEST. How do I do this?

Thanks in advance




Barb Reinhardt

ActiveSheet header including a named range
 
Thanks, that does it.

"Ron de Bruin" wrote:


Do you want this Barb

.CenterHeader = _
"&""Arial,Bold""&12" & Range("PROGRAM").Value & " Test:" & _
"&""Arial,Regular""&10" & Chr(10) & "Last date saved: " & _
Format(ThisWorkbook.BuiltinDocumentProperties("las t save time").Value, "dd-mmm-yyyy")

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Barb Reinhardt" wrote in message
...
I've had difficulty posting this so am not if it's been posted. If this is a
duplicate, please accept my apologies.

I have the following worksheet_beforeprint event

Sub Workbook_BeforePrint(Cancel As Boolean)
Application.ScreenUpdating = False
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = _
"&""Arial,Bold""&12 TEST: &""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
Application.ScreenUpdating = True
End Sub

For the CENTER HEADER, I want to display the named range PROGRAM prior to
the value TEST. How do I do this?

Thanks in advance






All times are GMT +1. The time now is 11:42 PM.

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