If formula in header

  • Thread starter Thread starter bg19299 via OfficeKB.com
  • Start date 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.
 
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:
 
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.
 
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
 

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

Back
Top