+ Reply to Thread
Results 1 to 3 of 3

VB.NET line break in header code

  1. #1
    Elena
    Guest

    VB.NET line break in header code

    Thanks to Chip's help, I have the code to set up a header on my Excel
    Worksheet:

    CDRLWs.PageSetup.LeftHeader = "CDRL: " & ComboBox2.Text & " DID No.: N/A"

    Yet, I was wondering if there was a way to put a line break in the middle.

    I would like my left header to look like this (currently, it is on one line):

    CDRL: A001
    DID No.: N/A

    Is there a way to set this up properly?

    Thanks in Advance,
    Elena

  2. #2
    Chip Pearson
    Guest

    Re: VB.NET line break in header code

    Elena,

    Try something like

    ActiveSheet.PageSetup.CenterHeader = "Line One" & Chr(10) & "Line
    Two"


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "Elena" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks to Chip's help, I have the code to set up a header on my
    > Excel
    > Worksheet:
    >
    > CDRLWs.PageSetup.LeftHeader = "CDRL: " & ComboBox2.Text & " DID
    > No.: N/A"
    >
    > Yet, I was wondering if there was a way to put a line break in
    > the middle.
    >
    > I would like my left header to look like this (currently, it
    > is on one line):
    >
    > CDRL: A001
    > DID No.: N/A
    >
    > Is there a way to set this up properly?
    >
    > Thanks in Advance,
    > Elena




  3. #3
    Elena
    Guest

    Re: VB.NET line break in header code

    PERFECT!

    "Chip Pearson" wrote:

    > Elena,
    >
    > Try something like
    >
    > ActiveSheet.PageSetup.CenterHeader = "Line One" & Chr(10) & "Line
    > Two"
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >
    >
    > "Elena" <[email protected]> wrote in message
    > news:[email protected]...
    > > Thanks to Chip's help, I have the code to set up a header on my
    > > Excel
    > > Worksheet:
    > >
    > > CDRLWs.PageSetup.LeftHeader = "CDRL: " & ComboBox2.Text & " DID
    > > No.: N/A"
    > >
    > > Yet, I was wondering if there was a way to put a line break in
    > > the middle.
    > >
    > > I would like my left header to look like this (currently, it
    > > is on one line):
    > >
    > > CDRL: A001
    > > DID No.: N/A
    > >
    > > Is there a way to set this up properly?
    > >
    > > Thanks in Advance,
    > > Elena

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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