Hello and thank you for any help you can offer. I'm trying to do two things that I need help with.
The range below in the Print_PDF_Player Macro, $B$1:$L$150, is actually the largest range that will contain any data to be printed and includes B1:L6 that I want to just be repeated at the top of each page.
I would like to make it so the range (B7:L150) is looked at dynamically, finding the last row containing any real data and setting the page breaks for 8.5 x 11 with margins set as 1/2 inch all the way around and with the previously mentioned range of cells repeated at the top of each page; B1:L6.
I found code for finding the last row with data but have no idea how I can integrate it into the Print_PDF_Player macro.
Sub Find_Last_Row()
'
' Find_Last_Row Macro
'
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
.PageSetup.PrintArea = "B1:L" & LastRow
End With
End Sub
Sub Print_PDF_Player()
'
' Print_PDF_Player Macro
'
Dim rng As Range
Dim fileName As String
'
Set rng = Sheets("PlayerReport").Range("$B$1:$L$150")
fileName = Sheets("Reports").Range("C5") & "\" & Sheets("PlayerCapture").Range("L1") & ".pdf"
rng.ExportAsFixedFormat Type:=xlTypePDF, _
fileName:=fileName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, _
From:=1, To:=1, OpenAfterPublish:=True
End Sub
Thanks!
Bookmarks