Filtering

  • Thread starter Thread starter desmondleow
  • Start date Start date
D

desmondleow

I am trying to write a macro to help me in my filtering of a list of
data. I have a list of references and I need to filter the list of
references according to the following criteria:

1) Starts with 325 and
2) last three digits >=100 AND <150, OR last three digits >=250 AND
<300

My list of references looks like this:
3513338009
3513338032
3883338008
3953338166
3953338167
3953338171
3953338274
3193338861
...

I tried to use the excel function [=right()] but however, this function
returns a text and I am unable to filter my list according to my
criterial. Can anyone help me on this? thanks!
 
Hi,

try
=value(right(A1,3))
this will give you a number instead of text.


in the same cell you could write a formula that checks all criteria and
results in an "x" or nothing if all criteria are met. then you can filter by
"x". so, you wouldn't have to bother too much with the criteria when
filtering.

arno
 
add another columnfor the right three digits
You're really doing three things, taking a number,
converting it to text, taking the right three characters
and then putting them back as numbers

so your "filter" is

IF left(text,3)= "325" and _
clng(Right(text,3))>=100 and _
clng(Right(text,3))<=150 then


for a simpler solution just add an extra column with the
=right( ,3) the add this column to the filter
 
Back
Top