View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
mdavison mdavison is offline
external usenet poster
 
Posts: 9
Default Cell contents in header/footer

Here is the formula used to look up the data - it works perfectly well.

=IF($B$3=0,0,LOOKUP($B$3,Sheet2!$A$2:$A$175,Sheet2 !$G2:G$175))

Hereis the code I got from a previous post to add the above cell contents
into the left header. Its also works - but not 100% of the time.

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

Thanks all.


"JLatham" <HelpFrom @ Jlathamsite.com.(removethis) wrote in message
...
It would help if you posted the formula used to get the information. I
suspect that the formula contains a specific reference to the workbook you
used to set it up initially. That reference needs to be taken out of the
formula (if I'm right) so that it doesn't try to reference or link to your
workbook.

Check and see if you have links in any of the workbooks you created for
others: Edit | Links - and if this is the case, you'll see reference to

link
to (your original) workbook.

"mdavison" wrote:

I'm sorry but I can't find the original thread, so I am posting to both
groups.

Someone asked how to display the contents of a cell in the header or

footer
and someone else gave the code. works great! Thanks.
One issue: I am trying to use this in an overtime form, saved as an XLS

in
Read Only format in MailSite v.8.0 SP1. Can't use it as an XLT in our
Novell/Win XP/Office 03/Interwoven environment.

I have users entering their employee ID number, which looks up their
concatenated name & department for display. But it also adds a special
department in a field which is formatted with white text so users wont

freak
out and THAT is where the code in my header is supposed to pull the
reference from. IE: The cell contents are volatile. But now, every

single
user's printout show MY department code in the header instead of the one
that matches their own lookup.
Is there some sort of fresh code that I need?

Please help! Thanks,
-Monica