Filters Not filtering

tantric_lover

New Member
Joined
Jul 5, 2006
Messages
10
Hi,

Has anyone ever come across the following problem...and of course if they have a solution that would be fab.

I am extracting data via ODBC to an Excel sheet. Using VB Code I am doing an Advanced Filter on one of the items which is a Project Code (4 numerals). Now I have a misc Proj code of 9999 which I want to filter out which I have set up in code on the Worksheet_Change procedure.

Here is the code for that section:
Worksheets("Net Spend").Range("Database") _
.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("Net Spend").Range("S2:T3"), _
CopyToRange:=Range("A2:Q2"), Unique:=False

S2 to T3 are :
AFE Year- Project
2005 - <>9999

Now the Project Code of 9999 is not filtered out. But if I go to the cell with 9999 in it, press F2 then Return and then reapply the filter it works. The Year part works fine btw.

I don't understand why it won't filter out 9999 until I go on each cell and hit F2 - Return.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi

The number must have been imported as text. That's why it's not recognised. When you hit F2 and return, excel automatically converts it to number.

You may have to convert all numbers.

Select a column, Data>Text to columns, click Finish.

Hope this helps
PGC
 
Upvote 0
Hi

The number must have been imported as text. That's why it's not recognised. When you hit F2 and return, excel automatically converts it to number.

You may have to convert all numbers.

Select a column, Data>Text to columns, click Finish.

Hope this helps
PGC

That worked fine. I done it on the ODBC sheet. So I jsut need to remember to do text To Columns - Finish every time I refresh the data. Thanks for that.
 
Upvote 0

Forum statistics

Threads
1,214,624
Messages
6,120,591
Members
448,973
Latest member
ksonnia

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