headers from cell value

colleen

Board Regular
Joined
Feb 21, 2002
Messages
61
I have spreadsheet with over 30 worksheets, for each sheet I print out I have several headers which I have to use..to make my life simpler HOW can i enter the header contents in a cell in sheet1, which will automatically enter that into the headers on all the sheets, then all I have to do is to change that cell in sheet1 with a different header content and it just replaces the same..HELP
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Hi colleen,

Probably the easiest way to do this is to edit the header cells as a "3-d range". Such a range has "depth" in that it includes other worksheets than the one that is active. To do a 3-d cell edit, select ALL the sheets you want to be changed when you edit a cell on the active sheet. To select all worksheets, simply right-click on the tab of the worksheet you want to type the heading into, then select Select All Sheets. You can of course select just certain sheets by holding down the Ctrl key as you left-click on the worksheet tabs.

Once the sheets are selected, anything you enter in a cell in the active worksheet will be entered into the corresponding cells on all the other selected sheets.

Be careful! If you forget to unselect the sheets when you make changes intended for only one sheet, you may inadvertently wipe out data in the other sheets. Of course, an Undo will usually get you out of this if you discover the problem soon enough.
 
Upvote 0
thanks damon, that really helps but what I really want to have a worksheet in which I can enter in a cell what I want to enter as a header on the other sheets. So I can just change the cell content and all the other sheets header is updated in one swoosh (for lack of a better word)...Col
 
Upvote 0
Suppose your header is in cell A1 of Sheet1.

In cell A1 of Sheet2 (or wherever your header is) type the formula:

=Sheet1!$A$1

Copy the formula to wherever the header is on your other sheets.
 
Upvote 0
Place this or similar code in the ThisWorkbook module

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftHeader = Sheet1.Range("$A$1").Text
End With
End Sub
 
Upvote 0
thanks a lot for your help..now to further my query, my header consist of several cell contents i.e. $a$1 with company name $b$1 with address. So how do I go about incorporating both the company name and address in the header..col
 
Upvote 0
You can also define the centerheader and right header, or add more than one cell reference to a header, as below

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftHeader = Sheet1.Range("$A$1").Text & Chr(13) & Sheet1.Range("$B$1").Text
.RightHeader = Sheet1.Range("$A$3").Text
End With
End Sub

Note: The CHR(13) is a line break
This message was edited by lenze on 2002-09-03 09:35
 
Upvote 0
If it's a true print header (Lenze) then:

.LeftHeader = Sheet1.Range("$A$1").Text & " " & Sheet1.Range("$B$1").Text

If it's only text on the sheet (me), then:

=Sheet1!$A$1&" "&Sheet1!$B$1
 
Upvote 0
On 2002-09-03 09:35, colleen wrote:
Also lenze how do I go about starting a NewWorkBook module..colleen

The ThisWorkBook Module already exists when you open a WorkBook. You can access it throught the Project Explorer in the VBA Editor, or the easiest way is to Right Click on the Excel Icon To the left of the Word file on the Menu Bar and choose View Code
This message was edited by lenze on 2002-09-03 09:42
 
Upvote 0

Forum statistics

Threads
1,203,388
Messages
6,055,129
Members
444,763
Latest member
Jaapaap

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top