PC Review


Reply
Thread Tools Rate Thread

ActiveSheet header including a named range

 
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      13th Oct 2006
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("last 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
 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      13th Oct 2006

Do you want this Barb

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

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



"Barb Reinhardt" <(E-Mail Removed)> wrote in message
news:48DF07DC-F78C-4351-8966-(E-Mail Removed)...
> 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("last 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



 
Reply With Quote
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      16th Oct 2006
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("last save time").Value, "dd-mmm-yyyy")
>
> --
> Regards Ron de Bruin
> http://www.rondebruin.nl
>
>
>
> "Barb Reinhardt" <(E-Mail Removed)> wrote in message
> news:48DF07DC-F78C-4351-8966-(E-Mail Removed)...
> > 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("last 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

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Named Range in Customer Header Rebecca_SUNY Microsoft Excel Misc 1 13th Apr 2009 10:37 PM
Using a named range in a header with VBA? slingsh0t@hotmail.com Microsoft Excel Misc 5 27th Oct 2005 10:52 AM
Named Range in Center Header Joel Mills Microsoft Excel Programming 6 5th Jan 2005 08:03 PM
Including a named range in VBA Todd Microsoft Excel Misc 7 14th Sep 2004 06:29 PM
Including Date Range Parameter in Page Header Anita Taylor Microsoft Access Reports 2 22nd Mar 2004 06:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:58 PM.