If you want a non-VBA solution that responds immediately to changing
values in your data range, you can create a list of the unique values
by entering the following formula in a cell in another column (assuming
your data range is named Data)
=INDEX($A:$A,SMALL(IF(MATCH(Data,$A:$A,0)=ROW(Data),ROW(Data),""),ROW(1:1)))
Enter it as an array formula with Ctl-Shift-Enter and drag down as far
as you need to get all unique values. If you drag beyond that point
you will get #NUM errors, which may or may not bother you.
If column A contains other values outside the range Data that interfere
with the above formula, then use this formula
=INDEX(Data,SMALL(IF(MATCH(Data,Data,0)=ROW(INDIRECT("1:"&ROWS(Data))),ROW(INDIRECT("1:"&ROWS(Data))),""),ROW(1:1)))
also entered as an array, and dragged down as far as necessary. This
formula may be longer but it is more reliable, given the potential for
extraneous data in the column.
You can eliminate the #NUM and replace them with blanks with this array
formula
=IF(ROW(1:1)>COUNT(IF(MATCH(Data,Data,0)=ROW(INDIRECT("1:"&ROWS(Data))),ROW(INDIRECT("1:"&ROWS(Data))),"")),"",INDEX(Data,SMALL(IF(MATCH(Data,Data,0)=ROW(INDIRECT("1:"&ROWS(Data))),ROW(INDIRECT("1:"&ROWS(Data))),""),ROW(1:1))))
or you could simplify the whole thing by using a helper column, say
column B. Put this (non-array) formula in B2, assuming your data
starts in A2,
=IF(COUNTIF($A$2:A2,A2)=1,ROW(),"")
and drag down to the end of your data. Then, in the first cell where
you want the unique list, enter
=IF(ROW(1:1)>COUNT(B:B),"",INDEX(A:A,SMALL(B:B,ROW(1:1))))
an drag down as far as necessary.
HTH
Declan O'R