Enter Multiple lines using .leftheader

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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"
 
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
 

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

Back
Top