Excel VBA header and footer font size

Pookster

New Member
Joined
Jun 15, 2009
Messages
4
Hi all,

I have silently used this site for a while now, always managing to find the answer I needed until now!!

I have a workbook, the coding contained within was originally created by someone else, that uses a userform macro to populate some custom doc properties and some named cells. The information used in these cells are then used to build the headers and footers when the userform "ok" button is activated.

I have made some changes which were needed and everything works great except that I cannot get the centre header and footer font type and size as is required. I need the font to be size 16 and bold, but I just cannot get it to work.:confused:

The code used to populate the centre header and footer is as follows:

If .CenterFooter <> valuePM Then .CenterFooter = valuePM
If .CenterHeader <> valuePM Then .CenterHeader = valuePM

PM being a custom doc property.

Please can the collective help, for I am a lost soul!!!


Regards,

Pookster.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi. Try like this

Code:
If .CenterFooter <> valuePM Then .CenterFooter = "&""Times New Roman,Regular""&16" & valuePM
 
Upvote 0
Hi thanks for the reply,

I'm afraid that this doesn't work.

The H & F still is unchanged...


Regards,

Pookster.
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,151
Members
452,891
Latest member
JUSTOUTOFMYREACH

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