I need to extract unique values, from more than one column, individually. What I mean is I have a column of "City" and another of "County" and I want to populate userfrom combo boxes with unique values of cities and counties. From what I can tell you can only use advanced filter once - here is what I have:
City works fine, but County will only bring over the header row. Thanks for any ideas.
Code:
Sub unique_values_city()
Dim lastrow As Long
lastrow = Cells(Rows.Count, "C").End(xlUp).Row
Sheets("Prospects").Select
Columns("AJ:AK").ClearContents
Range("C1:C" & lastrow).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _
"AJ1"), Unique:=True
Range("F1:F" & lastrow).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _
"AK1"), Unique:=True
End Sub
City works fine, but County will only bring over the header row. Thanks for any ideas.
Last edited: