close

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

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()