Hi friends,
I need a macro to auto filter and save the result as an image.
Would you please help me?
I found this code but it "prints" the result i need to save the result as an image.
Sub Auto_Print_Lamp_PK()
Dim noDupes As New Collection
Dim rw As Long
Dim itm As Variant
Selection.AutoFilter Field:=2
rw = ActiveSheet.AutoFilter.Range.Row
For Each cell In ActiveSheet.AutoFilter.Range.Columns(2).Cells
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:=2, Criteria1:=itm
Selection.AutoFilter Field:=2, Criteria1:=itm
ActiveSheet.PrintPreview
Next
End Sub
source : https://www.mrexcel.com/forum/excel-questions/730566-macro-automatic-printing-using-autofilter.html
I need a macro to auto filter and save the result as an image.
Would you please help me?
I found this code but it "prints" the result i need to save the result as an image.
Sub Auto_Print_Lamp_PK()
Dim noDupes As New Collection
Dim rw As Long
Dim itm As Variant
Selection.AutoFilter Field:=2
rw = ActiveSheet.AutoFilter.Range.Row
For Each cell In ActiveSheet.AutoFilter.Range.Columns(2).Cells
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:=2, Criteria1:=itm
Selection.AutoFilter Field:=2, Criteria1:=itm
ActiveSheet.PrintPreview
Next
End Sub
source : https://www.mrexcel.com/forum/excel-questions/730566-macro-automatic-printing-using-autofilter.html