Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Unique Values, not Unique Records | Excel Discussion (Misc queries) | |||
Count Unique Values but not Filtered or Hidden Values | Excel Worksheet Functions | |||
Count unique values and create list based on these values | Excel Worksheet Functions | |||
create list of unique values from a column with repeated values? | Excel Worksheet Functions | |||
How do I search thr'o column and put unique values in differnt sheet and sum corresponding values in | Excel Programming |