Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default adding cell reference on a header

I would like to know if Excel accomdates adding cell references within the
header / footer area so that everytime the contents in that cell within the
worksheet, the header also gets updated and shows up with the updated
information when it is printed.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default adding cell reference on a header

Put something like this in ThisWorkbook code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.LeftHeader = Range("A1").Value
End Sub

Not in a standard module
--
Gary's Student


"Sima" wrote:

I would like to know if Excel accomdates adding cell references within the
header / footer area so that everytime the contents in that cell within the
worksheet, the header also gets updated and shows up with the updated
information when it is printed.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 139
Default adding cell reference on a header

I was searching through the posts and this question mirrors what I'm trying
to do. I right clicked the tab on my spreadsheet, clicked on view code and
then copied/pasted the code listed. The only change I made was the cell
reference (B3). It didn't work and I know I probably did something wrong.
Can someone tell me what step I missed?

Thanks!
--
Tina


"Gary''s Student" wrote:

Put something like this in ThisWorkbook code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.LeftHeader = Range("A1").Value
End Sub

Not in a standard module
--
Gary's Student


"Sima" wrote:

I would like to know if Excel accomdates adding cell references within the
header / footer area so that everytime the contents in that cell within the
worksheet, the header also gets updated and shows up with the updated
information when it is printed.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default adding cell reference on a header

Tina

The beforeprint code is not sheet code.

It is workbook code.

Right-click on the Excel icon left of "File" on the menu bar or on the Excel
icon at left end of title bar if not maximized.

Select "View Code" to open the Thisworkbook module.

Paste the code into that module.


Gord Dibben MS Excel MVP

On Wed, 28 Mar 2007 13:42:03 -0700, Tina wrote:

I was searching through the posts and this question mirrors what I'm trying
to do. I right clicked the tab on my spreadsheet, clicked on view code and
then copied/pasted the code listed. The only change I made was the cell
reference (B3). It didn't work and I know I probably did something wrong.
Can someone tell me what step I missed?

Thanks!


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 139
Default adding cell reference on a header

Works like a charm.....Thank you!
--
Tina


"Gord Dibben" wrote:

Tina

The beforeprint code is not sheet code.

It is workbook code.

Right-click on the Excel icon left of "File" on the menu bar or on the Excel
icon at left end of title bar if not maximized.

Select "View Code" to open the Thisworkbook module.

Paste the code into that module.


Gord Dibben MS Excel MVP

On Wed, 28 Mar 2007 13:42:03 -0700, Tina wrote:

I was searching through the posts and this question mirrors what I'm trying
to do. I right clicked the tab on my spreadsheet, clicked on view code and
then copied/pasted the code listed. The only change I made was the cell
reference (B3). It didn't work and I know I probably did something wrong.
Can someone tell me what step I missed?

Thanks!





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
cell reference in header Dana Excel Discussion (Misc queries) 3 January 30th 07 09:39 PM
Cell References [email protected] Excel Discussion (Misc queries) 2 November 15th 06 11:37 PM
Excel: can I refer to cell reference in page setup header nikos Excel Worksheet Functions 0 February 21st 06 06:23 PM
how do I format a cell reference to move as source changes KGray Excel Worksheet Functions 1 August 13th 05 12:41 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 12:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"