Old Code - Seems to be acting differently

kgkev

Well-known Member
Joined
Jun 24, 2008
Messages
1,291
Office Version
  1. 365
Platform
  1. Windows
After at least 2 years of running the same report one of my output files is no longer correct.

I have narrowed this down to a single line of code that seems to be acting incorrectly.


Code:
Sheets("Chasing").Range("$A$4:$Z$955").AutoFilter Field:=4, Criteria1:="*W*"

I believe this should be apply the filter to column "D" however the filter is applied to "E"


If I change the code...

Code:
Sheets("Chasing").Range("$A$4:$Z$955").AutoFilter Field:=3, Criteria1:="*W*"

It works as it used to.

Out of interest I changed field to 2 and 1 which now corresponds to column C & B.
It is not possible for me to apply the filter to column "A"

I have created a new book with a small sample of data and the original code works as it should.


This doesn't seem right, any ideas?
 
Last edited:

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Probably not without seeing the workbook. Is there a dropdown at the top of column A?
 
Upvote 0
WOW!!!

Manually removed the filter. Changed the code back to field 4...works perfect.
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,270
Members
452,628
Latest member
dd2

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