#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Formula in Header

Can you put a formula in a header? in my macro?

My macro runs a function then puts the words "Accounts market Values as of "
in the header but I would like the header to say "Accounts market values as
of 7/31/07" (prior month end date) for example. Can this be done???? Please
help. Below is what I have now:

ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "Plumb Trust Company" & Chr(10) & "Account Market
Values as of "
.RightHeader = ""
.LeftFooter = "&Z&F"
.CenterFooter = ""
.RightFooter = "&P"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Formula in Header

.CenterHeader = "Plumb Trust Company" & Chr(10) _
& "Account Market Values as of " & _
format(date-day(date),"m/d/yy")



Donna S wrote:

Can you put a formula in a header? in my macro?

My macro runs a function then puts the words "Accounts market Values as of "
in the header but I would like the header to say "Accounts market values as
of 7/31/07" (prior month end date) for example. Can this be done???? Please
help. Below is what I have now:

ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "Plumb Trust Company" & Chr(10) & "Account Market
Values as of "
.RightHeader = ""
.LeftFooter = "&Z&F"
.CenterFooter = ""
.RightFooter = "&P"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Formula in Header

It worked.....thank you so much.

Donna

"Dave Peterson" wrote:

.CenterHeader = "Plumb Trust Company" & Chr(10) _
& "Account Market Values as of " & _
format(date-day(date),"m/d/yy")



Donna S wrote:

Can you put a formula in a header? in my macro?

My macro runs a function then puts the words "Accounts market Values as of "
in the header but I would like the header to say "Accounts market values as
of 7/31/07" (prior month end date) for example. Can this be done???? Please
help. Below is what I have now:

ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "Plumb Trust Company" & Chr(10) & "Account Market
Values as of "
.RightHeader = ""
.LeftFooter = "&Z&F"
.CenterFooter = ""
.RightFooter = "&P"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula in a header Donna S Excel Discussion (Misc queries) 1 August 3rd 07 03:49 PM
If formula in header bg19299 via OfficeKB.com Excel Discussion (Misc queries) 3 August 22nd 06 05:24 PM
Custom Header with Formula Randy Excel Discussion (Misc queries) 6 June 15th 06 12:14 PM
Can you put a formula in a header? bozrdang Excel Discussion (Misc queries) 8 May 16th 06 03:46 AM
Select header if formula Krista F Excel Worksheet Functions 11 April 11th 05 07:26 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"