I got this code from another EE answer. Playing with it, and not sure I understand the line marked with **.
ALSO, the macro works, but not exactly what I'm looking for. It does the auto repeat rows in Excel and allows me to change the auto repeat rows for the last page correctly. BUT, I want to create a .pdf when I run the macro instead of sending out a print job.
How can I tweak to make this happen. Code follows:
'macro written by nutsch on 4/23/08, with lots of inspiration from http://www.rondebruin.nl/print.htm
Dim TotPages As Long
**TotPages = application.ExecuteExcel4M
.PageSetup.PrintTitleRows = "$1:$7"
.PrintOut From:=1, To:=TotPages - 1
.PageSetup.PrintTitleRows = "$1:$6"
.PrintOut From:=TotPages, To:=TotPages