Get acquainted with amazing service here

Have any questions? Just call us 061 361 3802

Printing Excel Auto Filters

Printing excel auto filters on spreadsheet, we will use the Auto filter option and Print option in Microsoft Excel 2010.

Auto Filter: – This option allows us to filter the data based on content of cells and conditions applied on them.

We can filter the data according to the particular text, month, date, number, cell color, font color, etc. Even we can sort the data as per the number, text, cell colors, and font colors, etc.

Using the below code we can run a macro to print an entire spreadsheet filtered by data in a specific column.

Sub PrintAutoFilter()
Dim noDupes As New Collection
Dim rw As Long
Dim itm As Variant
Selection.AutoFilter Field:=1 ‘Column that the autofilter printing must filter
rw = ActiveSheet.AutoFilter.Range.Row
For Each cell In ActiveSheet.AutoFilter.Range.Columns(1).Cells ‘Column that the autofilter printing must filter
If cell.Row <> rw Then
On Error Resume Next
noDupes.Add cell.Value, cell.Text
On Error GoTo 0
End If
Next
For Each itm In noDupes
Selection.AutoFilter Field:=1, Criteria1:=itm ‘Column that the autofilter printing must filter
ActiveSheet.AutoFilter.Range.PrintOut ‘Change PrintOut to PrintPreview to test
Next
End Sub

excel-autofilter-printing

Share: