View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Desert Piranha
 
Posts: n/a
Default Page Header concern


Bri Wrote:
Greetings (I'm not sure this is posted to the right forum)

a) How do I put the contents of a cell into the header? (will vary
from
worksheet to worksheet)

b) I'm sure I'm missing something obvious, but where do I set the LEFT
and
RIGHT header margins? (I can only find top and bottom) I'd like them
to be
the same as the L and R margins for printing the main body of the
document.

Thank you
BriHi Bri,

For question A:
If your interested in doing it by code, this will take whatever is in
cell A3 on each sheet
and put it into the header on that sheet. You can change for your
needs.
Will work for veiwing or printing. The code must go into the "Workbook"
module.

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

You can use
.LeftHeader or .CenterHeader or .RightHeader
.LeftFooter or .CenterFooter or .RightFooter


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=506005