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(quot;A1quot;).text
End With
End SubGord Dibben Excel MVP
On Thu, 15 Dec 2005 21:08:03 -0800, quot;Paddyquot; gt;
wrote:
gt;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(quot;sheet1quot;)
.PageSetup.CenterFooter = .Range(quot;a1quot;).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:
www.mvps.org/dmcritchie/excel/getstarted.htm
Paddy wrote:
gt;
gt; In Excel is it possible to put a cell referenc in a header or footer?
--
Dave Peterson
- Jul 16 Mon 2007 20:38
Excel header/footer cell reference
close
全站熱搜
留言列表
發表留言