VBA Change Header Font Size and Text

Dmichaud61

Board Regular
Joined
Mar 7, 2014
Messages
69
Office Version
  1. 2016
Platform
  1. Windows
Greetings
Can the below VBA string be modified to add the word "Date:" before the actual date, and change the font to Ariel 12 point bold? I'm using MS Office Professional 2013 and Windows 10 Enterprise.

RightHeader = Format(Date, "dd-mmm-yy") & Chr(10) & "Page: &P of:&P"

As an example, the string currently produces the following results:

17-Sep-19
Page: 1 of 10

I want the sting to produce:

Date: 17-Sep-19
Page: 1 of 10

Thanks in advance!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Try
Code:
RightHeader = "&""Arial,Bold""&12Date: " & Format(Date, "dd-mmm-yy") & Chr(10) & "Page: &P of:&P"
 
Upvote 0
Peter - much appreciated. Your edits worked perfectly! I've been trying for several hours without any success.
 
Upvote 0

Forum statistics

Threads
1,224,737
Messages
6,180,653
Members
452,992
Latest member
TokugawaIesuma

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