View Single Post
  #3   Report Post  
Harlan Grove
 
Posts: n/a
Default another interesting thing...

Nick Dangr wrote...
....
What I'd like to do is take this column from sheet 1 and have the data
autofiltered to sheet 2 so it appears as such, removing repetitions:

....
The trick is, I want to see it happen automatically, and when the first
sheet refreshes, I'd like to have the 2nd sheet automatically refresh
also.

....

Assuming your source data is in a single column, and the range
containing that data were named D, then you could do this with
formulas. If the topmost result cell were A1 in another worksheet, try
the following array formulas.

A1 [array formula]:
=INDEX(D,MATCH(0,COUNTIF(D,"<"&D),0))

A2 [array formula]:
=IF(SUM(COUNTIF(D,A$1:A1))<COUNTA(D),
INDEX(D,MATCH(COUNTIF(D,"<="&A1),COUNTIF(D,"<"&D), 0)),"")

Fill A2 down as needed.

Note: such formulas are inefficient. Filtering and sorting would be
more efficient. It'd be better to use a Calculate event handler to run
an advanced filter against the range D, copying it's distinct records
to another location, then sorting the result.