Syntax problem in Page Header build

LostInVBA

New Member
Joined
Apr 6, 2011
Messages
3
I am using XP-Pro with Office2010 and am having problems with formatting my Header Text when I try to print the worksheet.

I have the following code;

With ActiveSheet.PageSetup
.LeftHeader = "Data as of:" & Chr(10) & vGenDate
.CenterHeader = _
" &B&""Comic Sans MS""&14Supposed to be line 1 &B&""Ariel""&10 Suppose to be line 2 Suppose to be line 3 with " & vGenLoc
end with

The LeftHeader prints fine on two lines as it recognized the carriage return/line feed ( Chr(10) )


I am unable to determine how to write the CenterHeader getting the system to recognize the carriage return/line feed. As written the text comes out with the correct fonts, size, and bold characteristics, but as a single continuous line.

Ideally, someone will respond with the correct syntax so I can write,
With ActiveSheet.PageSetup
.CenterHeader = _
vLine1 & vline2 & vline3
end with

and have all the formatting down in the variables.

THANKS!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,224,609
Messages
6,179,874
Members
452,949
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top