Headers

M

marcia2026

Is it possible to programmically add the contents of a particular cell as
part of the header. This routine opens a report created in a txt format in
Excel. It will be done over and over again. I would like to be able to the
dates of the report into the header so that the user does not have to do it
manually each time.

thanks
 
J

JLGWhiz

Assume a date is entered in cell B10 of sheet 1.

Sub borne()
myDate = Sheets(1).Range("B10").Value
Sheets(1).PageSetup.RightHeader = myDate
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