Announcement

Collapse
No announcement yet.

[Solved] Header / Footer

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Solved] Header / Footer



    Is there a way I can have a custom header or footer get information from a cell in a worksheet? Thanks for looking.
    :banghead:
    Chuck Behrens

  • #2
    Putting this code in Module 1 will put the value of cell A1 into the center header.

    Sub HeaderFromCell()
    With ActiveSheet.PageSetup
    .CenterHeader = Range("A1").Value
    End With
    End Sub

    Using the VBE, place the following code in Sheet1:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    HeaderFromCell
    End Sub

    This updates the header when the contents of Sheet1 change.

    HTH
    Brandtrock

    Brandtrock Consulting | Brandtrock Files | ISU Athletics | Bricktown | VBA Express

    Comment


    • #3


      That worked like a champ!
      Thank you. :clap2:
      Chuck Behrens

      Comment

      Working...
      X