Headers and Footers in VBA
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftHeader = "Line 1" & vbCr & "Line 2"
End With
End Sub
'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code
--
HTH
Bob Phillips
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"JacMar" wrote in message
...
I use Excel 2002. I recently got info from this group about printing
headers
and footers on selected pages, and it worked very well. Now my question
is;
How do I specify a multi line header (of footer), in a format similar to
an
address, ie:
Name
Street address
City, State
Zip Code
I have not been able to find code to force a Carriage Return.
Thanks in advance
|