Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula in a header | Excel Discussion (Misc queries) | |||
If formula in header | Excel Discussion (Misc queries) | |||
Custom Header with Formula | Excel Discussion (Misc queries) | |||
Can you put a formula in a header? | Excel Discussion (Misc queries) | |||
Select header if formula | Excel Worksheet Functions |