Print Sheet Title Formatting


Posted by Sandro on January 25, 2002 5:17 AM

I'm trying to use VBA coding to format the title on a sheet before it prints. I know how to code it if the title is always the same. I also know how to insert the variable title ( see below ). Now I'm stuck because I can't format it.


sheetname3 = Range("e1")
ActiveSheet.PageSetup.CenterHeader = sheetname3
End Sub

Therfore, this will insert the contents of cell E1 into the top of the printed sheet, but the formatting will be default settings.



Posted by Ivan F Moala on January 25, 2002 7:51 AM

Followng example may help;
Note: Name of Font, &8 = size AND apostrophes!

With ActiveSheet.PageSetup
'## headers here ##
.CenterHeader = "&""Arial Black,Bold""&8 " & sheetname3
'## footers here ##
.CenterFooter = "&""Arial Black,Bold""&8 " & sheetname3
End With


Ivan