Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
Put this in theThisWorkbook code module. Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim vHeaderCells As Variant Dim wsSheet As Worksheet Dim i As Long Application.EnableEvents = False Cancel = True For Each wsSheet In ActiveWindow.SelectedSheets With wsSheet If .Name = "Sheet1" Then vHeaderCells = Array("A1", "A50", "A100") For i = 1 To UBound(vHeaderCells) + 1 .PageSetup.LeftHeader = _ .Range(vHeaderCells(i - 1)).Value .PrintOut from:=i, To:=i, preview:=True Next i Else .PrintOut preview:=True End If End With Next wsSheet Application.EnableEvents = True End Sub Change "Sheet1" to suit. In article , "Emiel" wrote: Does anybody have a clue if and how I can use the text from a cell in the first line of each page in the header? For example: Page 1: A1 Page 2: A50 Page 3: A100 etc. Thanks in adance. Emiel (Holland) 0. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Header Text | Excel Discussion (Misc queries) | |||
Can't view Header Text | New Users to Excel | |||
Header Row Cell Text | Excel Worksheet Functions | |||
Replace &F in header with text | Excel Discussion (Misc queries) | |||
How to reference a text cell that changes weekly in Header or Foo. | Excel Discussion (Misc queries) |