ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB.NET line break in header code (https://www.excelbanter.com/excel-programming/355888-vbulletin-net-line-break-header-code.html)

Elena

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

Chip Pearson

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" wrote in message
...
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




Elena

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" wrote in message
...
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






All times are GMT +1. The time now is 02:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com