View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Can I link a cell's contents to the header or footer in Excel?

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

On Mon, 21 Aug 2006 14:47:32 -0700, djoslyn
wrote:

I'm trying to set up spreadsheets where the footer changes depending on
certain cells contents. Has anyone been able to do that?

Thanks.