Thread: Uniqe list
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Uniqe list

This macro will copy your range to another sheet, sort it,
then delete all the extra entires leaving you with a
unique list. it is case sensative.

Sub Macro1()
Sheets("Sheet1").Select
Range("A1:A100").Copy
Sheets.Add
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom
Dim tc As Range
Dim ntc As Range
Set tc = Range("a1")
Do While Not IsEmpty(tc)
Set ntc = tc.Offset(1, 0)
If tc.Value = ntc.Value Then
tc.EntireRow.Delete
Set tc = ntc
Else
Set tc = ntc
End If
Loop
End Sub
make changes to the sheet names and range references.
good luck.
-----Original Message-----
I have a large problem that I cannot find a simple

formula for. Been looking
and trying now for over a year.

As follows: A1:A100 is filled with data that is often

repeated. There may
also be some blanks. In this data there may be anywhere

from 2 to 100 unique
pieces of data that I would like to extract and put in

column B1 thru
B....(however many unique pieces of data have been

extracted).

Example:
A B
1 George George
2 Sam Mike
3 Mike Sam
4 Sam Zachary
5 George
6 Mike
7 Zachary
8 Sam
9 George
10 Zachary

It seems so simple and I cant believe Microsoft does not

have a formula or
function for this. Keep in mind that this is an example

and the real
worksheets have thousands of entries with 100s of unique

pieces of data. This
appears to be a fundamental stopping point for me in

creating spreadsheets
that automatically create reports for me without bogging

down the computer.
I have gotten around it by using Rank, match, and index

but it really bogs
me down and if it doesnt go into "not responding" then it

could take up to 10
minutes to open. (Pent 4.., etc. state of the art up to

date computers)

Would very very much appreciate a simple formula that can

achieve this.
Thank you



--
Jason
.