I want to filter a column with particular value.
Problem Statement:
Excel looks like below and the worksheet name is "Current_Data".
I need to filter the third column with value "VP" and get the output using Autofilter.
Code snippet:
Sub Filter_CP()
Sheets("Current_Data").Range("A1:D4000").AutoFilter Field:=3, Criteria1:="VP"
End Sub
I receive the below error:
"Run-time error 1004: AutoFilter method of range class failed"
Instead of "Sheets", I tried with "Worksheets", without any luck.