View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
NikkiB NikkiB is offline
external usenet poster
 
Posts: 9
Default reference a cell within the header

Doug,

I'm sorry I don't think I explained my properly.

I tried the code and if the value in cell C2= "1" my header reads as follows:
Schedule C2 Attachment A1

I was hoping there would be a way to insert the value from cell C2 between
the words Schedule and Attachment so that my header would read as follows:
Schedule 1 Attachment A

Is this possible?

I apologize for the confusion.

Thank you so much for your time.

Nikki

"Doug Glancy" wrote:

NikkiB,

Assuming your header is still in Sheet1:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Sheets("Sheet1").PageSetup.CenterHeader = "Schedule C2 Attachment A" &
Sheets("Sheet1").Range("C2").Value
End Sub

hth,

Doug

"NikkiB" wrote in message
...
I would like to enter the value from a cell into a header. For Example. I
want the header to say "Schedule C2 Attachment A" with the value of cell
C2
displayed within the header.

I found the below code but do not know if its possibe to adjust for what I
need.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Sheets("Sheet1").PageSetup.CenterHeader =
Sheets("Sheet1").Range("A1").Value
End Sub

Thanks in advance for any help.