View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Zone[_3_] Zone[_3_] is offline
external usenet poster
 
Posts: 373
Default Sub to extract uniques from 200k data in xl03

Tom, good point. I probably should have used some variation of rows.count.
How would you do this, otherwise using the same code? James

"Tom Ogilvy" wrote in message
...
Just note that if the OP has data down to rows 65536 in columns 1 to 3 (as
is
probable based on the description), you will miss examining 65535 names in
each of those columns.

--
Regards,
Tom Ogilvy


"Zone" wrote:

Max, this is surely a simple-minded approach to the problem, but it
should
work. It will take a long time to run. I assumed that the data is in
Sheet1 with no column headings and that Sheet2 is an unused sheet. HTH,
James

Sub Uniques4Columns()
Dim FromRow As Long, FromCol As Integer
Dim ToRow As Long, ToCol As Integer
Dim This As Variant, c As Range
Worksheets(2).Activate
Cells.Clear
ToCol = 1: ToRow = 1
With Worksheets(1)
For FromCol = 1 To 4
For FromRow = 1 To .Cells(65536, FromCol).End(xlUp).Row
This = .Cells(FromRow, FromCol)
Set c = Cells.Find(This, LookIn:=xlValues,
lookat:=xlWhole)
If c Is Nothing Then
Cells(ToRow, ToCol) = This
ToRow = ToRow + 1
If ToRow 65535 Then
ToRow = 1
ToCol = ToCol + 1
End If
End If
Next FromRow
Next FromCol
End With
End Sub

"Max" wrote in message
...
Using xl 2003, subject to 65k row limit. I've got over 200k ids listed
in
cols A to D from row1 down. Looking for a sub which can extract the
unique
ids from amongst the 200k into a new sheet, listing these ids into as
many
cols as may be required, ie down col A, then down col B, etc. Thanks
for
insights.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---