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.
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.