Linking the header to a cell

C

Chad

Is it possible to link the header to a cell?

i.e. I have entered "John Doe" into cell B6 of worksheet "Data4". Is
it possible for the header to link to the cell B6 and show "John Doe"?

-Thanks
-Chad
 
F

Frank Kabel

Hi Chad
there is no way to directly insert a formula / cell reference into the
header/footer of an Excel worksheet
definition. You have to use the workbook event Before_print to insert
cell values into the header. e.g.
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ActiveWindow.SelectedSheets
With wkSht.PageSetup
.CenterHeader = Worksheets("Data4").Range("B6").value
End With
Next wkSht
End Sub

HTH
Frank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top