+ Reply to Thread
Results 1 to 3 of 3

link to cell in header or footer

  1. #1
    Robert Ehrlich
    Guest

    link to cell in header or footer

    what I like to do in Excel:

    - in any register for ex. "Register" I have included in cell "A1" text like
    "project ABC"
    - this text should be present in the header on top of the page when I print
    out
    - so I'm be able to change the header depends on the text in the cell

    I'm looking for any possibility to include this "=Register!A1" in the header

    Any idea?
    How can help?


    Robert



  2. #2
    Gary''s Student
    Guest

    RE: link to cell in header or footer

    If you put this small macro in worksheet code:


    Sub Worksheet_Change(ByVal Target As Excel.Range)
    If Intersect(Range("A1"), Target) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    ActiveSheet.PageSetup.CenterHeader = Range("A1").Value
    Application.EnableEvents = True
    End Sub

    It will automatically detect changes to cell A1 and put the contents in the
    header.
    --
    Gary's Student


    "Robert Ehrlich" wrote:

    > what I like to do in Excel:
    >
    > - in any register for ex. "Register" I have included in cell "A1" text like
    > "project ABC"
    > - this text should be present in the header on top of the page when I print
    > out
    > - so I'm be able to change the header depends on the text in the cell
    >
    > I'm looking for any possibility to include this "=Register!A1" in the header
    >
    > Any idea?
    > How can help?
    >
    >
    > Robert
    >
    >
    >


  3. #3
    JB
    Guest

    Re: link to cell in header or footer

    Modify header with Cell:

    If A1 contains formula, there is no change for A1. Use event
    Before_Print

    Private Sub Workbook_BeforePrint(Cancel As Boolean)
    If ActiveSheet.Name = "Sheet1" Then
    ActiveSheet.PageSetup.CenterHeader = Sheets("Feuil1").Range("A1")
    End If
    End Sub

    http://cjoint.com/?fuqCncpEoK

    Cordialy JB


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1