+ Reply to Thread
Results 1 to 2 of 2

Header/Footer formation VBS - text in multiple lines(rows)

  1. #1
    Registered User
    Join Date
    04-01-2021
    Location
    Latvija
    MS-Off Ver
    MS 2016
    Posts
    27

    Header/Footer formation VBS - text in multiple lines(rows)

    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!

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,937

    Re: Header/Footer formation VBS - text in multiple lines(rows)

    I think you will have to insert a picture of a horizontal line using something like:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Header/Footer How to populate Header with Text and Cell Value together
    By lomarica in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-21-2016, 01:42 PM
  2. size header text footer
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-11-2016, 01:04 PM
  3. Header/Footer & Repeating Rows/Columns in Email?
    By Aus10G2 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-07-2012, 06:16 PM
  4. [SOLVED] Removing header and footer rows from data
    By spikeyc in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-22-2012, 09:51 PM
  5. Copy header & footer with pictures & text
    By Samantha McNeill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-12-2011, 08:32 PM
  6. Changing the color of header and footer text
    By Singhu in forum Excel General
    Replies: 2
    Last Post: 12-15-2005, 06:25 PM
  7. Help with repeat rows for header & Footer
    By Jeff in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2005, 11:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1