Skip to content

Cell Reference to Excel Header / Footer [Only VBA will do]

The only way: use a VBA macro. E.g.

ActiveSheet.PageSetup.LeftFooter = "Check: " &  Sheets(SETTINGS_SHEET_NAME).Range("F4").Value

2 Comments

  1. Brianna wrote:

    I would like to reference cell A1 to the header in excel 2007 for all worksheets in workbook. What would the formula be for that?
    Thanks

    Posted on 20-Aug-12 at 10:50 pm | Permalink
  2. Jussi wrote:

    Loop through sheets: http://www.vbaexpress.com/kb/getarticle.php?kb_id=390

    So maybe something like the following? (Can't test the code right now, so if it doesn't work, you're on your own.)


    Option Explicit

    Sub LoopThroughSheets()
    Dim ws As Worksheet
    For Each ws In ActiveWorkbook.Worksheets

    '** Perform code here **

    'E.g.
    On Error Resume Next 'Will continue if an error results
    ws.PageSetup.LeftHeader = "Check: " & Sheets(SETTINGS_SHEET_NAME).Range("A1").Value

    '***********************

    Next ws
    End Sub

    Posted on 21-Aug-12 at 10:37 pm | Permalink