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

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
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,213,536
Messages
6,114,208
Members
448,554
Latest member
Gleisner2

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