I need to extract the unique values in column B, for every unique value in column A. I have a code from a post but it lists out the entire column's unique values. What I want are only those unique values that are associated with the filter criteria I have provided.
I need to move these unique values to an array and use it for another sheet calculation. The code I have so far is below.
Sub test()
Dim TestRg As Excel.Range
Dim Array1(200) As Variant
Dim i, j As Integer
i = 1
Set TestRg = Range("L1:L181")
TestRg.AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
ActiveCell, Unique:=True
For Each C In TestRg.SpecialCells(xlCellTypeVisible)
If Not (C) Is Nothing Then
Array1(i) = C.Value
i = i + 1
End If
Next C
j = i - 1
i = 1
For i = 1 To j
Debug.Print Array1(i)
Next
End Sub
Pl help.