ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Defining Font Size in VBA (https://www.excelbanter.com/excel-discussion-misc-queries/153966-defining-font-size-vba.html)

CherylH

Defining Font Size in VBA
 
Hi all, I have the following code (shown below) in order to print the "last
revision date" in my footer. I would like to have the font size be "8" for
both the literal "Last Revision Date" AND the date inserted by the code.

I've searched and found "TextEffect.FontSize = xx", where xx equals the font
size wanted. However, I have no idea where to insert this in the code below
- can someone help me please? I've just starting using visual basic editor
so am not too familiar with all this code!

Thanks in advance!
Cheryl
===============================================

Code:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = "Last Revision Date:" & " " &
Format(Now(), "mm/dd/yyyy")

End Sub


roadkill

Defining Font Size in VBA
 
Try inserting "&08" (that's ampersand followed by the desired font size using
2 digits) into you footer text. Like this "ActiveSheet.PageSetup.RightFooter
= "&08" & "Last Revision . . .

Will

"CherylH" wrote:

Hi all, I have the following code (shown below) in order to print the "last
revision date" in my footer. I would like to have the font size be "8" for
both the literal "Last Revision Date" AND the date inserted by the code.

I've searched and found "TextEffect.FontSize = xx", where xx equals the font
size wanted. However, I have no idea where to insert this in the code below
- can someone help me please? I've just starting using visual basic editor
so am not too familiar with all this code!

Thanks in advance!
Cheryl
===============================================

Code:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = "Last Revision Date:" & " " &
Format(Now(), "mm/dd/yyyy")

End Sub


CherylH

Defining Font Size in VBA
 
Thank you roadkill - I appreciate your help! (p.s. love the user name!!!)

"roadkill" wrote:

Try inserting "&08" (that's ampersand followed by the desired font size using
2 digits) into you footer text. Like this "ActiveSheet.PageSetup.RightFooter
= "&08" & "Last Revision . . .

Will

"CherylH" wrote:

Hi all, I have the following code (shown below) in order to print the "last
revision date" in my footer. I would like to have the font size be "8" for
both the literal "Last Revision Date" AND the date inserted by the code.

I've searched and found "TextEffect.FontSize = xx", where xx equals the font
size wanted. However, I have no idea where to insert this in the code below
- can someone help me please? I've just starting using visual basic editor
so am not too familiar with all this code!

Thanks in advance!
Cheryl
===============================================

Code:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = "Last Revision Date:" & " " &
Format(Now(), "mm/dd/yyyy")

End Sub



All times are GMT +1. The time now is 09:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com