How do I use an Excel cell in footer

  • Thread starter Thread starter PETE
  • Start date Start date
P

PETE

I am trying to use the contents of an Ecel cell in the footer of the
document. Is this possible?
 
Pete,

Alt+F11 to open VB editor. Double click 'This Workbook' and paste this code in

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim WS As Worksheet
For Each WS In Worksheets
WS.PageSetup.LeftFooter = Worksheets("Sheet1").Range("A1").Value
Next WS
End Sub

Mike
 
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftFooter = ActiveSheet.Range("A1").Value
End With
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code
 

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

Back
Top