I need to make a filter with a certain value in a tab of a worksheet, after the filter is done, I need to copy, open a new document, and paste this information.
I have developed the code below but it is not working.
follow the code
Sub filtrar()
Worksheets(Array("Planilha3", "Planilha2", "Planilha3",)).Copy
ActiveSheet.Range("Planilha3").AutoFilter Field:=Range("E1:E1048576").Column, Criteria1:="Cell 01"
With ActiveWorkbook
ActiveWorkbook.SaveAs Filename:=fname1, FileFormat:=xlOpenXMLWorkbookMacroEnabled
ThisWorkbook.Save
ThisWorkbook.Close
End With
End Sub