Hi, everyone! I tried to figure out how to write the code for Headers/Footers, that the text will appear in two rows. Is it possible to draw horizontal line under the text? I attached small picture, how it should look in the Header.
My VBA code is:
Sub AddHeaderToAll()
'Update 20140318
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection.Range("A1")
Set WorkRng = Application.InputBox("Range (single cell)", xTitleId, WorkRng.Address, Type:=8)
For Each ws In Application.ActiveWorkbook.Worksheets
ws.PageSetup.LeftHeader = WorkRng.Range("A1").Value
Next
End Sub
header.PNG
If I want to make font formation, should I need to write new code?
Hope to find the solution, thank you!![]()
Bookmarks