Is there a way I can have a custom header or footer get information from a cell in a worksheet? Thanks for looking.
:banghead:
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!
Is there a way I can have a custom header or footer get information from a cell in a worksheet? Thanks for looking.
:banghead:
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
:usaflag:
That worked like a champ!
Thank you. :clap2:
Don’t have an account yet? Register yourself now and be a part of our community!