Sub Array_With_Unique_Values()
Dim strArray(0 To 19) As String
j = 0
For i = 2 To 20
If Worksheets("Sheet1").Cells(i, 1).value <> "" Then
strArray(j) = Worksheets("Sheet1").Cells(i, 1).value
j = j + 1
End If
Next i
For n = 1 To 19
For p = 0 To 19
If strArray(n) = strArray(p) And n <> p Then
strArray(n) = ""
End If
Next p
Next n
m = 2
For k = 0 To 19
If strArray(k) <> "" Then
Worksheets("Sheet2").Cells(m, 2).value = strArray(k)
m = m + 1
End If
Next k
End Sub
No comments:
Post a Comment