If formula in header

  • Thread starter bg19299 via OfficeKB.com
  • Start date
B

bg19299 via OfficeKB.com

Is it possible to have a header look at a cell to determine what it should
say? I am currently doing two scenarios in my excel file. When a cell in a
different tab says "1" I want the header to say "10 Year Amortization",
otherwise I want it to say "15 Year Amortization". There will also be text
above the 10 or 15 Year amortization line which is consistent for the two
scenarios. Is this possible? Thanks in advance.
 
M

Marcelo

Hi

=if(a1=1,"10 Year Amortization","15 Year Amortization")

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"bg19299 via OfficeKB.com" escreveu:
 
B

bg19299 via OfficeKB.com

Thanks for the reply but this does not work within the header. When I type in
an if statement all it does is put the text in the header as opposed to it
calculating the if statement.
 
G

Gord Dibben

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub

Better yet...............

Place the code in a BeforePrint event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Text
End With
End Sub

Right-click on the Excel Icon left of "File" on the menubar.

Select "View Code"

Copy/paste the BeforePrint code above into that module.


Gord Dibben MS Excel MVP

Thanks for the reply but this does not work within the header. When I type in
an if statement all it does is put the text in the header as opposed to it
calculating the if statement.

Gord Dibben MS Excel MVP
 
Top