PDA

View Full Version : Solved: Printing Headers to all sheets on printout?



Simon Lloyd
12-09-2007, 03:28 PM
Hi all, i am currently using a snippet of code to print a custom header on the activesheet which works fine however i am having trouble adapting it to work with ActiveWorkbook.PrintOut ActiveSheet.PageSetup.CenterHeader = "&""Arial,Bold Italic""&14 Line Settings For " & Chr(13) _
& CB1VCB1V is a combobox value.

Any ideas?

Norie
12-09-2007, 03:59 PM
Simon

If that's a value from a combobox then you I don't think you can refer to it like that.

How did you create the combox?

Simon Lloyd
12-09-2007, 05:13 PM
Norie the value from the Combobox isn't an issue as the code works fine (the combobox is on a worksheet and the code is run from there along with others!), my only issue is getting the header to printout on all visible sheets, if i print seperate sheets one at a time then i get the header as i need but if i use activeworkbook.printout i only get the header on the first sheet!

Simon Lloyd
12-09-2007, 05:25 PM
I cured it by having the seets in an array and using:

For Each Sh In Sheets(arr)
With Sh
.PageSetup.CenterHeader = "&""Arial,Bold Italic""&14 Line Settings For " & Chr(13) _
& CB1V
.PrintOut
End With
Next Sh