Print Cell-Information in Page-Header/Footer

  • Thread starter Thread starter Reiner Harmgardt
  • Start date Start date
R

Reiner Harmgardt

Hi NG,

is it possible to print the information of a cell in then
page-header or footer.
if so, can i declare in the page-header/footer-definition
to print let's say the cell A5.
if it's possible, how can i do it.

Thangs for helping.

Regards

Reiner
 
Hi
only possible with using VBA (an event procedure -
beforeprint). Would this be a feasible way for you?
 
Hi Frank

thanks for helping.
As i'm not to heavy in Excel, i can't see where and how i could do the way
you mentioned.
Where can i find the option beforeprint and how
to activate then the procedure.

Regards

Reiner
 
Hi
Put the following code in your workbook
module (not in a standard module):
Private Sub Workbook BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In me.Worksheets
With wkSht.PageSetup
.CenterFooter = wks.range("A1").value
End With
Next wkSht
End Sub

To get to the workbook module:
- open the VBA editor (ALT+F11)
- locate in the left treeview the entry 'Thisworkbook'
- double-click on that and inser the code

Also see
http://www.cpearson.com/excel/events.htm
 
Back
Top