Print Cell-Information in Page-Header/Footer

  • Thread starter Reiner Harmgardt
  • 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
 
F

Frank Kabel

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

Reiner Harmgardt

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
 
F

Frank Kabel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top