Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

program to change my header font size

Status
Not open for further replies.

sahmiele

Technical User
Sep 9, 2003
67
US
I need some code to change my header's font size. I have roughly 250 files all with different headers and need to change the font size in each of them. I can't seem to get the code to change the font size without changing the header itself. I want to set up a loop to update each of them, but when I use the macro recorder, it puts in the header text into the code, which would then give me the exact same header in all 250 unique files. Please Help!
 
Hi,

Please post the code that you currently have.

Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
looper = Application.InputBox("Enter the number of files that are being updated. ", "AE files count", , , , , , 1)
ZZZZ = 0


Do While ZZZZ <> looper

With ActiveSheet.PageSetup
.CenterHeader = _
"&""Arial,Bold""&20 2004 DC LITER REPORT CARD - Kendall Montagriff"
End With

ZZZZ = ZZZZ + 1
ActiveWorkbook.Save
ActiveWindow.Close
Loop




The "2004 DC LITER REPORT CARD - Kendall Montagriff" part is variable. That is the current header of the file I have open. I do not want to change the text, just the size. The next file's header is ""2004 DC LITER REPORT CARD - Tania Chavez". Thanks!
 

Code:
'dim before loop
    Dim a, i, sHeader As String
    

    With ActiveSheet.PageSetup
        a = Split(.CenterHeader, " ")
        sHeader = "&""Arial,Bold""&20"
        For i = 1 To UBound(a)
            sHeader = sHeader & " " & a(i)
        Next
        .CenterHeader = sHeader
    End With

Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top