ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Customize Header From Cell Value (https://www.excelbanter.com/excel-discussion-misc-queries/42919-customize-header-cell-value.html)

Jenn

Customize Header From Cell Value
 
Is there a way to have the header of a workbook come from a value in a cell?
I have a template and would like to have the user type in what their project
name is in cell A1 and then have the Header become the value that they typed.
TIA!

Gord Dibben

Jenn

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub

This is workbook event code.

With the workbook open and maximized, right-click on the Excel logo left of
"File" on menu bar.

Select "View Code".

Paste the above code in that module.

Note: only the active sheet will have that header.


Gord Dibben Excel MVP


On Mon, 29 Aug 2005 15:26:06 -0700, "Jenn"
wrote:

Is there a way to have the header of a workbook come from a value in a cell?
I have a template and would like to have the user type in what their project
name is in cell A1 and then have the Header become the value that they typed.
TIA!




All times are GMT +1. The time now is 08:13 AM.

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