Need code to change font size in custom footer?

Barry Katcher

Well-known Member
Joined
Feb 25, 2002
Messages
4,053
I have the following macro which inserts the full path and file name in a footer:

Sub InsertPathInFooter
ActiveSheet.PageSetup.LeftFooter =
ActiveWorkbook.FullName
End Sub

What can I add to it to then change the font size from 12 to 9? I tried recording a macro for Page Setup/Custom Footer/Font icon, etc. It does change the font on the worksheet, but I don't see any line of code in the macro that does the change.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Thanks, lenze. I added the following excerpt from your code:

With ActiveSheet.PageSetup.LeftFooter = "&""Ariel,Bold""&7"
End With

The macro ran without an error message, but nothing changed, neither font not font size nor bold. What am I missing?
 
Upvote 0
Hi Barry:

Try this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftFooter = "&""Arial,Bold""&7" & ActiveWorkbook.FullName
End With
End Sub

Note the spelling of ARIAL
 
Upvote 0
Thanks a mill, lenze. I just changed "bold" to "regular" and it works perfectly. I'll also add it to my "save before closing" macro and to my "print" macro, in case I save the file to a different folder. Thanks again.
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,204
Members
449,072
Latest member
DW Draft

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