Sub test()
Dim first(1 To 8, 1 To 2) As Integer
Dim second() As Integer
Dim a As Integer
Dim b As Integer
Dim c As Integer
first(1, 1) = 1
first(1, 2) = 15
first(2, 1) = 2
first(2, 2) = 16
first(3, 1) = 3
first(3, 2) = 16
first(4, 1) = 4
first(4, 2) = 16
first(5, 1) = 5
first(5, 2) = 16
first(6, 1) = 6
first(6, 2) = 17
first(7, 1) = 7
first(7, 2) = 17
first(8, 1) = 8
first(8, 2) = 17
ReDim second(1 To UBound(first, 1))
b = 0
For a = 1 To UBound(first, 1)
If Application.Match(first(a, 2), Application.Index(first, 0, 2), 0) = a Then
b = b + 1
second(b) = first(a, 2)
End If
Next a
ReDim Preserve second(1 To b)
Range("a1").Resize(b, 1).Value = Application.Transpose(second)
End Sub