Thread: Footer Font
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ShaneDevenshire ShaneDevenshire is offline
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?