reference cell in header

S

Steve_n_KC

Thanks to the reply to this post:
Subject: what code pulls in contents of a cell in an Excel header/footer?
7/14/2005 12:05 PM PST
I was able to successfully reference a cell in the header of one sheet of my
original document: However the document I have put together asks the users a
series of questions then saves the file under a new name.

Is it possible to have the NEW document that has all the same tabs just a
different file name still retain the background code that references the cell?

(the referenced cell and the sheet name will always remain the same, only
the workbook file name will change)

Using this code in ThisWorkbook frame of VBAProject:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Sheets("PMC").PageSetup.CenterHeader = (Sheets("PMC").Range("b63").Value) &
(Sheets("PMC").Range("b61").Value)

End Sub

I'm getting the custom header original text in the new workbook but with no
code behind it so the information is incorrect.
 

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