ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I use an Excel cell in footer (https://www.excelbanter.com/excel-discussion-misc-queries/216268-how-do-i-use-excel-cell-footer.html)

Pete

How do I use an Excel cell in footer
 
I am trying to use the contents of an Ecel cell in the footer of the
document. Is this possible?

Mike H

How do I use an Excel cell in footer
 
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

"PETE" wrote:

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


Bob Phillips[_3_]

How do I use an Excel cell in footer
 
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

--
__________________________________
HTH

Bob

"PETE" wrote in message
...
I am trying to use the contents of an Ecel cell in the footer of the
document. Is this possible?





All times are GMT +1. The time now is 06:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com