PDA

View Full Version : Solved: Integral cells as header



circaa
06-28-2006, 07:32 AM
Hi

My sheet has 9 columns and many many rows and rows are added every day. Each column has a title. I have a command button to print the sheet. I want my code to copy all 9 titles(cells and their format) and put them as a header on every page printed.

any ideas ?

hope I'm clear enough

Joey

lucas
06-28-2006, 07:39 AM
Hi Joey,
If I understand you correctly you wish to have the header row repeat on each printed sheet. This can be accomplished with page setup easily.
Go to File-page setup
Select the sheet Tab
look for the line that says "Rows to repeat at top"
click the icon on the right end of the window and click on row 1 to add it.

circaa
06-28-2006, 08:01 AM
Thanks Steve

Didn't know about that...still so much to learn about excel

But how do I do that by the code under the commandbutton "print" ?

Joey

lucas
06-28-2006, 08:14 AM
Here is one example for you to expound upon.....works on active sheet only as written.
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$1"
End With
End Sub


but there is no need to do this as once its set up it stays set.
you can split your screen so that your header row does not scroll off the screen by going to window-split....set the bars where you want them and then click on window-freeze panes.