Rows to repeat at top Except for the last page

  • Thread starter Thread starter nenzax
  • Start date Start date
N

nenzax

Hi all,

I have a excel sheet with 3 sections and i have setup the "Row to
repeat at top" to a row in the pagesetup.

how do i go about removing the property(Row to repeat at top) in the
page where the second section ends progrmatticaly.

i dont want the rows headers appearing in all the pages.

Thanks
Nen
 
Hi

Try this one

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$1"
ActiveSheet.PrintOut From:=1, To:=TotPages - 1
.PrintTitleRows = ""
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End With
End Sub
 
Back
Top