#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,344
Default Footer Font

Hi,

Try this to handle the other problems:

Sub Macro1()
myFooter = ActiveSheet.PageSetup.CenterFooter
myLen = Len(myFooter)
For I = 1 To myLen
If Mid(myFooter, I, 1) = "&" And IsNumeric(Mid(myFooter, I + 2, 1))
Then
O = I + 3
Exit For
ElseIf Mid(myFooter, I, 1) = "&" And IsNumeric(Mid(myFooter, I + 1,
1)) Then
O = I + 2
Exit For
End If
Next I
myText = Mid(myFooter, O, myLen - 1)
With ActiveSheet.PageSetup
.CenterFooter = _
"&""Arial,Regular""&10" & myText
End With
End Sub
--
Cheers,
Shane Devenshire


"Shimmess" wrote:

Thanks for the reponse, but the below will cause two issues he

1. As you mention, there can be timres when the original footer font is less
than 10 and
2. What if the footer has a number in it.

Any other suggestions?

"ShaneDevenshire" wrote:

Hi,

There are probably easier ways to do this by the following code seems to work:

Sub ResetFormat()
myFooter = ActiveSheet.PageSetup.CenterFooter
myLen = Len(myFooter)
For I = 1 To myLen
t = Mid(myFooter, I, 1)
If IsNumeric(Mid(myFooter, I, 1)) Then
Exit For
End If
Next I
myText = Mid(myFooter, I + 2, myLen - 1)
With ActiveSheet.PageSetup
.CenterFooter = _
"&""Arial,Regular""&10" & myText
End With
End Sub

This code assumes that the font size to start with was at least 10, if this
is not the case you need to do some additional testing. I have only tested
this in 2003.

--
Regards,
Shane Devenshire


"Shimmess" wrote:

I want to force the footer font to Arial Regular 10 for a group of workbooks
in a subdirectory. I understand that excel uses the following formatting:
.LeftFooter = "&""Arial""&10"TEXT. The problem I have is that the text is
unknown and not always the same. So the first book might have a footer of
ABC times new roman 12 bold and the second may have a footer of XYZ Century
26 Italics and I want to force both to Arial Regular 10. Is this possible?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Footer font formating in Excel Brian Barbre[_2_] Excel Programming 6 December 1st 08 06:45 PM
Add Font to Header/Footer macro JHL Excel Discussion (Misc queries) 4 January 5th 07 07:45 PM
Different font in footer on first worksheet than the others watchtower83 Excel Discussion (Misc queries) 6 January 2nd 07 08:31 PM
Colour of font in header/footer Gilbert De Ceulaer New Users to Excel 1 March 19th 06 02:04 PM
changing font type in a footer ajd Excel Programming 5 January 25th 06 12:40 AM


All times are GMT +1. The time now is 08:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"