Power Query Course in Spanish
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Excel Header Formatting

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    135
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    In my VB Code I need to copy the header from one worksheet to another and then reformat the font size and font name but I can't seem to strip the old formatting out. Any ideas?

  2. #2
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try the following code:

    With Worksheets("New Worksheet").PageSetup
    .CenterHeader = "&""Times New Roman,Regular""&8The Old Header"
    End With

    This code sets the center header for a worksheet called "New Worksheet" to the text "The Old Header" in regular 8 point Times New Roman font.
    Best regards,
    Allan Chara
    http://www.mrspreadsheets.com

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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