View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
Pam in California
 
Posts: n/a
Default Can custom headers be linked to a cell in the worksheet?

One more question - the font prints small. What's the line I would use to
print times roman 12 pt.

Thanks again for your help.
-pam


"Dave Peterson" wrote:

Does that worksheet name have a space between words or an underscore?

Expense_Worksheet
or
Expense Worksheet

You have to match it exactly the way you see it on the tab itself.



Pam in California wrote:

So my macro would look like this:
Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Worksheets ("Expense_Worksheet")
.PageSetup.LeftHeader = .Range("e7").Text
End With
End Sub

Sorry to be dense on this. The header isn't pulling the information from e7
so I think I haven't done this properly.
-pam

"Dave Peterson" wrote:

You would change this:

With Worksheets("sheet1")
to
With Worksheets("Expense Worksheet")
(It has to match exactly.)

(It really is named "expense worksheet"??)





Pam in California wrote:

I'm trying to enter this marco, and need some clarification as I am having
some trouble with with macro.
With Worksheets("sheet 1"), sheet 1 would be the worksheet that contains
the information, and the range "a1" is the cell, correct? My worksheet name
is Expense Worksheet. Do I need to change the worksheet name to
Expense_Worksheet?

I would like the text in cell a1, which is my e7, to be in the header on all
7 of my worksheets - is this possible?

I hope this makes sense. Thanks for your help.
-pam

"Dave Peterson" wrote:

You could use a macro...

For instance, this code goes behind the ThisWorkbook module:

Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Worksheets("sheet1")
.PageSetup.LeftHeader = .Range("a1").Text
End With
End Sub



Texas_Toast wrote:

This was a feature in 123 where header or footer information could be
retrieved from a cell in the worksheet. Is there anything similar in Excel?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson