VBA to set AutoFilter to List all rows with same values in column?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

XL 2003

If I had data in column B like:

Col A Col B Col C
R1 xx 1 vt
R2 qq 3 er
R3 tt 2 lk
R4 ll 1 ha
R5 cv 2 ne
R6 ws 1 xw

I would like "filtered" display to show:
R1 xx 1 vt
R4 ll 1 ha
R6 ws 1 xw
R3 tt 2 lk
R5 cv 2 ne



R2 qq 3 er Does not display because listed only once



Thus 1) sorted by value in Col B
2) Any "B" value with more than one item in the list

What is the smartest way to do this and be able to use it again and again.
(That is why I thought of VBA)

Thanks for any efforts.

I am hoping that someone may have this tool already designed and is willing
to share it?

Dennis
 
See if this example will help. It will return results where the Field1 value
exists more than once.

SELECT Table2.Field1, Table2.Field2, Table2.Field3
FROM Table2
WHERE (((DCount("Field1","Table2","Field1=" & [Table2].[Field1]))>1));
 
Back
Top