Monday, June 15, 2015

Value of Cell in Header

or Footer



The header and footer cannot contain a link to a cell. You can create and run a macro that will put the value of a cell into a footer or header. You could run this macro each time the contents of the specified cell changes.

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

Or use it as an Event code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.PageSetup.CenterHeader = Range("A1").Value
End Sub

OzGrid.com:
Information from a cell in a worksheet

Erlandsen Data Consulting:
Insert headers and footers

Chip Pearson:
Headers and Footers

Jan's Computer literacy 101:
Excel Basics: Setup Header/Footer



See all Topics

No comments: