Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 97 - AutoFilter strange characters

Status
Not open for further replies.

MrPeds

Programmer
Jan 7, 2003
219
0
0
GB
Hi,

I have some VBA Excel 97 code that carries out an AutoFilter on a column. e.g:

Selection.AutoFilter Field:=9, Criteria1:="<A", Operator:=xlAnd

I basically want to be able to filter on the rows that do not have a character A-Z, or the numbers 0-9. So things like "'", "," #, and so on would be displayed.

However, when i use the above code it returns rows with numbers in as well as the undesirable characters.

Do i need to format my column as text first, or do I need a better Criteria? Is there any other way to set the values that are allowable?

(Basically I want to auto filter the bad characters and then rename them to 'MISC').

thanks,

MrPeds
 
Hi,

Difficult filtering issue.

Why not use Edit/Replace?

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top