How do I add a cell reference in a header?

A

ags22282

I'm trying to add a cell reference in the header of an Excel document. The
workbook allows a user to select choices from a drop-down menu and pulls the
specific data into summaries, but I would also like the selection to change
the header each time.
 
F

Frank Kabel

Hi
only possible with VBA using an event procedure. e.g. put the following
code in your workbook module:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In Me.Worksheets
With wkSht.PageSetup
.CenterHeader = wkSht.range("A1").value
End With
Next wkSht
End Sub
 

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