Header & Footer

ExcelNovice

Well-known Member
Joined
May 12, 2002
Messages
583
Not sure this is possible, but who knows:

I want to include in the Header (using Page Setup or macro) the ability to use info in the spreadsheet.
Example, I want the Header to say, today's top sales category is T-Shirts. "T-Shirts" would be pulled from cell C4, so the Header should always pull the content of cell C4.

Is this possible?
Thanks
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
You can use the following code to enter the header in the center panel

Code:
Sub HeaderFromCellEntry()

' Macro -- 10/5/02 by Yogi Anand for Header from a cell entry
'
     ActiveSheet.PageSetup.CenterHeader = "Today's Top Category is " & [C4]
End Sub

Regards!

Yogi
This message was edited by Yogi Anand on 2002-10-05 19:10
 
Upvote 0
Thanks Yogi, but I can't get this to work...maybe I'm doing something wrong, but its not working.
 
Upvote 0
On 2002-10-06 00:17, ExcelNovice wrote:
Thanks Yogi, but I can't get this to work...maybe I'm doing something wrong, but its not working.

The macro that I posted earlier has to be run for the Page Header to include the entry from cell C4.

If you want to have it automated such that whenever you print that sheet, it will use your customized header (including the entry from cell C4), then you can put the code in ThisWorkbook's BeforePrint event ...

Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
' Macro -- 10/5/02 by Yogi Anand for Header from a cell entry
'
     ActiveSheet.PageSetup.CenterHeader = "Today's Top Category is " & [C4]
End Sub

Please post back if it works for you ... otherwise explain a little further and let us take it from there.

Regards!

Yogi
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

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