In Excel is it possible to put a cell referenc in a header or footer?
In Excel is it possible to put a cell referenc in a header or footer?
Paddy
With the use of VBA, yes.
Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub
Gord Dibben Excel MVP
On Thu, 15 Dec 2005 21:08:03 -0800, "Paddy" <[email protected]>
wrote:
>In Excel is it possible to put a cell referenc in a header or footer?
Via code? Yes.
You can use the workbook_beforeprint event to modify the header.
Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Me.Worksheets("sheet1")
.PageSetup.CenterFooter = .Range("a1").Text
End With
End Sub
This goes behind the ThisWorkbook module.
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
Paddy wrote:
>
> In Excel is it possible to put a cell referenc in a header or footer?
--
Dave Peterson
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks