It depends on what you want to do.
Do you want every worksheet in the workbook to have that header that from
Expense_worksheet (with the underscore)?
Do you want just some to have it?
Do you want to use E7 from each of the worksheets in that worksheet's header?
I'm guessing that not all get the header, but when it does, it comes from the
Expense_worksheet.
If I'm close, then one way:
Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wCtr As Long
Dim WksNames As Variant
WksNames = Array("Expense_Worksheet", "some other sheetname", "sheet 99")
For wCtr = LBound(WksNames) To UBound(WksNames)
Worksheets(WksNames(wCtr)).PageSetup.LeftHeader _
= Worksheets("expense_worksheet").Range("e7").Text
Next wCtr
End Sub
Just keep including the names you want in that array() stuff.
But remember to match them exactly.
I was able to get the macro to work on the first worksheet. What wording do
I use to have it work on subsequent worksheets. Do I list each worksheet
individually or change the .PageSetup.LeftHeader =.Range("Expense_Worksheet
e7").text or something like that.
thanks,
-pam