Copy Filtered Data with VBA

Turbo68

Board Regular
Joined
Jan 31, 2014
Messages
118
I am trying to get the DATA in my "Transactions" sheet to filter in 2 columns. The first one filters col A to "0" and the 2nd filters to the data in O1 cell. But it fails out every time on the 2nd filter with Run-time error '424' Object required.

Any help is appreciated.

Below is the part of my script that is failing.



Windows("Credit Card Summary V2 OCT_NOV.xlsm").Activate
Sheets("Transactions").Select

ActiveSheet.Range("$A$1:$K$1000").AutoFilter Field:=1, Criteria1:="0"
ActiveSheet.Range("$A$1:$K$1000").AutoFilter Field:=2, Criteria1:=FilterSH.Range("O1").Value
Range("CC_DATA").Select
Selection.Copy
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Have you declared & set FilterSH?
If O1 is on the Transactions sheet try
Code:
ActiveSheet.Range("$A$1:$K$1000").AutoFilter Field:=2, Criteria1:=Range("O1").Value
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,052
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top