ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I put a specific cells information in the header or footer. (https://www.excelbanter.com/excel-discussion-misc-queries/167361-how-do-i-put-specific-cells-information-header-footer.html)

bannshy9

How do I put a specific cells information in the header or footer.
 
I am wondering if it is possible to put the info from a specific cell in a
excel workbook into the Header or Footer

MasterMikey

How do I put a specific cells information in the header orfooter.
 
On Nov 26, 10:38 am, bannshy9
wrote:
I am wondering if it is possible to put the info from a specific cell in a
excel workbook into the Header or Footer


The only way you can include info from a specific cell is to use Excel
VBA:

You can include the value of a cell in the header. For example, the
following code will put the value of cell B5 on Sheet2 into the header
of the activesheet.

ActiveSheet.PageSetup.LeftHeader = _
Format(Worksheets("Sheet2").Range("B5").Value)

Bob Umlas, Excel MVP

How do I put a specific cells information in the header or footer.
 
You need to use VBA to do that. Right-click the Excel LOGO (Near the file
menu) and select View Code, paste this in (edit it to suit):
Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.LeftHeader = Range("A12").Value
End Sub
Bob Umlas
Excel MVP

"bannshy9" wrote:

I am wondering if it is possible to put the info from a specific cell in a
excel workbook into the Header or Footer



All times are GMT +1. The time now is 01:04 AM.

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