PDA

View Full Version : Save Worksheet as PDF but Ignore Hidden Rows



MikeeRDX
10-31-2015, 03:06 PM
Hi Forum,

I have a worksheet where I use filter to hide certain rows. The hidden rows are enough to form a page if they are unhidden. Then, I would like to save the worksheet as a PDF file. The macro below does the job; however, it also save the hidden rows as a blank page where my hidden rows have been. Can you help me?


Sub Sav2PDF()
ActiveSheet.Range("$n$4:$n$544").AutoFilter Field:=1, Criteria1:="1"
mydatestamp = Format(Date, "mm-dd-yyyy")
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"M:\Projects\" & "SIMC Calendar - ALL " & mydatestamp & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= True
End Sub

My preset print area ranges is A1:K544

Thank you for whatever help you can provide....

Kenneth Hobs
11-01-2015, 11:14 AM
Copy the Special cells that are visible to a scratch worksheet and export that to pdf.