Excel Header and Footer variables

  • Thread starter Thread starter Raymond Chiu
  • Start date Start date
R

Raymond Chiu

Dear all,

Can the excel page header or page footer have the variables which will be
assigned by vb.net program at run time??
How to set variables in page header or page footer? How to reference the
page header or page footer variables?

Thanks for your help,

Raymond
 
Hi Raymond,

You need to use VBA to do this. In the VBE you double click the
thisWorkbook object in the Project Explorer and choose Workbook from the
Object box and BeforePrint from the Procedures box and then write the
necessary code to do what you need.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
'my code here
End Sub
 
Back
Top