Here is the formula that I currently have.
Sub PDFOut()
ThisWorkbook.Sheets(Array("Cover Sheet", "Summary", "Back Page")).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"P:\Test.pdf", quality:=xlQualityStandard, includedocproperties:=True, _
ignoreprintareas:=False, openafterpublish:=True
ThisWorkbook.Sheets("Summary").Select
End Sub
I need this to do 2 things differently tho.
#1) While both "Cover Sheet" and "Back Page" can print from their preset print areas, I need the "Summary" sheet to only print the selection from B2:P(lastrow).
I was thinking this could be implemented somehow by the following...
Dim lastRow As Long
Dim printRng As Long
'finds last used row # in my column B, starting from 2nd row, for reference in printRng
With ActiveSheet
lastRow = .Range("B2" & .Rows.Count).End(xlUp).Row
End With
For i = lastRow To 1 Step -1
If Cells(i, "B2").Text <> "" Then
Exit For
End If
Next i
lastRow = i
'creates my print range variable
printRng = "B2" & ":" & "P" & lastRow
But How do I get something like this to fit into my current sheet array selection?
#2) I'd also like to supply a inputbox for the user to be able to name this PDF something unique, and have it automatically saved within the same folder as the Active.Workbook.
Which one of you geniuses are up for this challenge?
All joking aside, I greatly appreciate any help or guidance that you guys can possibly provide me. Not only will I give you a 1,000 good karma points, I will also not forget to provide the "Reputation" that you deserve.
Mike in Cali
Bookmarks