I have this bit of code I use to publish Excel pages to a PDF and then it is attached to an email. It works great except it captures everything on the target Excel page to include fields with a value of 0 which I would like for it to filter out. Not sure if this is even possible. Here is the code for the PDF:
On Error Resume Next
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
FileName:=Fname, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=OpenPDFAfterPublish
On Error GoTo 0
'If Publish is Ok the function will return the file name
If Dir(Fname) <> "" Then
Create_PDF_Sheet_Level_Names = Fname
End If
I have another section of code that PRINTS the target Excel sheets, but has a filter to eliminate the fields with 0. It looks like this:
.AutoFilterMode = False
.Range("A1:A" & .Range("A" & Rows.Count).End(xlUp).Row).AutoFilter 1, "<>0"
Is it possible to publish the target Excel pages to a PDF with the filter in place?
Your help and expertise is appreciated.
Ken
Bookmarks