Enter Multiple lines using .leftheader

C

Carol

I'm trying to create a module that can insert the same text in all worksheet
headers of a workbook. I've been able to insert single line entries only.
Is there any way I can enter multiple lines, such as can be done when you
enter custom headers?

ie. Left header I can enter: "Project Title" However I'd like to enter :
"Project Title"
"Client Name"

Carol
 
B

Bob Umlas

You can easily do it manually by putting the sheets in Group mode (Select
all the sheet tabs, update your header, then get out of group mode).
New line is by alt/Enter.
In VBA use vbcr
Activesheet.Pagesetup.Leftheader = "Project Title" & vbcr & "Client Name"
 
G

Gord Dibben

Carol

Sub Hearder_All_Sheets()
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.LeftHeader = "Project Title" & Chr(13) _
& "Client Name"
Next
End Sub


Gord Dibben MS Excel MVP
 
Top