Formula in Header

G

Guest

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
 
D

Dave Peterson

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

Guest

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

Donna

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top