ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I include a cell's value in a worksheet header? (https://www.excelbanter.com/excel-programming/346371-how-can-i-include-cells-value-worksheet-header.html)

BillSea

How can I include a cell's value in a worksheet header?
 
I am running Office XP pro. I want to display the value of a cell in the
header when I print a worksheet.

chijanzen

How can I include a cell's value in a worksheet header?
 
BillSea:

add this code to Thisworkbook Module

'ThisWorkbook
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftHeader = Range("A1")
'.CenterHeader = ""
'.RightHeader = ""
End With
End Sub


--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"BillSea" wrote:

I am running Office XP pro. I want to display the value of a cell in the
header when I print a worksheet.



All times are GMT +1. The time now is 02:04 PM.

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