LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default unique values

So you have 2600 cells, all filled with numbers? And you want to select the
unique numbers from this rectangular area?

Here's a macro that should suffice. If the range isn't what you described, fix
the line that begins with Const RangeRef


Sub GetNumbers()
Dim C As Long
Dim i As Variant
Dim N As Long
Dim Nums() As Double
Dim R As Long
Dim V As Variant
Dim X As Variant

Const RangeRef As String = "A1:Z100" '<<< FIX REFERENCE HERE IF NEEDED
V = Worksheets("Sheet1").Range(RangeRef).Value

ReDim Nums(1 To UBound(V, 1) * UBound(V, 2), 1 To 1)
N = 0

For R = 1 To UBound(V, 1)
For C = 1 To UBound(V, 2)
X = V(R, C)
If IsNumeric(X) Then
If X = 1 And X <= 1000 Then
i = Application.Match(X, Nums(), 0)
If IsError(i) Then
N = N + 1
Nums(N, 1) = X
End If
End If
End If
Next C
Next R
Worksheets("Sheet2").Cells(1).Resize(N, 1).Value = Nums()

End Sub




On Thu, 30 Sep 2004 13:55:14 -0700, "scrabtree"
wrote:

Hello. I have posted this question a couple times and
haven't got the answer I need yet. Past suggestions have
suggested using advanced filter, but that don't do what I
need.

I have a table in Sheet1 A1:Z100. I need, in Sheet2
Column A:A a list of all the unique values in Sheet1
A1:Z100 that are between the values of 1 and 1,000.

Please help!


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unique Values, not Unique Records steph44haf Excel Discussion (Misc queries) 1 May 12th 10 07:52 PM
Count Unique Values but not Filtered or Hidden Values Lee Excel Worksheet Functions 3 June 2nd 09 11:18 PM
Count unique values and create list based on these values vipa2000 Excel Worksheet Functions 7 August 5th 05 01:17 AM
create list of unique values from a column with repeated values? Chad Schaben Excel Worksheet Functions 1 July 8th 05 10:25 PM
How do I search thr'o column and put unique values in differnt sheet and sum corresponding values in test test Excel Programming 3 September 9th 03 08:53 PM


All times are GMT +1. The time now is 08:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"