PDA

View Full Version : VBA - Problem in .range



_Br_10
11-11-2022, 07:02 AM
Hi everyone. When i run this code on the 4th line appear an error 1004 "application defined or object- defined error, and i dont know what's the problem.
Can help me please?



With Worksheets("Zplan_producao")
.ListObjects("Z_Plan_Oficial").Range.AutoFilter FIELD:=2, Criteria1:="=LIB"
.ListObjects("Z_Plan_Oficial").Range.AutoFilter FIELD:=25, Criteria1:="=Paulo Leite"
.Range("A:A,B:B,E:E,F:F,G:G,I:I,J:J,K:K,R:R").Copy Sheets("Encomendas_liberadas").Range("A1")
End With

georgiboy
11-11-2022, 07:42 AM
I could not recreate the error, see if you have anything different in your set up compared to the attached.

It is always easier to get help if you create a dummy file like I have attached - sometimes in creating said file you will solve your own issue. It will help us to see the way you have set up your file, it will give us clues as to what could be going on.

p45cal
11-11-2022, 04:17 PM
_Br_10,
attach a workbook with this error occurring in it; there are too many unknowns to determine what's going wrong.
Also, what version of Excel are you using?