Advanced filter vba

H

heyitsthechad

Hello,
I have two worksheets. The first is a user screen that allows the
user to select from multiple combo boxes criteria for shipments.
These combo boxes are dependant on the previous combo box as to what
gets populated in them. The second screen screen contains the data
which fills these. After the last column of data unique values from
the first column are generated with a worksheet change function. I
would like to continue this process for the next list based on the
uniques in the first one.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Range(Range("A4"), Range("A4").End(xlDown)).AdvancedFilter _
Action:=xlFilterCopy, CopyToRange:=Range("AE4"), Unique:=True
ActiveWorkbook.Names.Add Name:="Ulist", RefersTo:="=" & _
Range(Range("AE5"), Range("AE5").End(xlDown)).Address
End If
End Sub

The dynamic range "Ulist" fills the first combo box like a charm. I
should be able to simply copy paste the code above for column 2,
rename the ranges, and get my uniques to fill that second combo box,
but I am missing one line of code that should only populate that list
with Uniques from column 2 based on uniques from column one. I cant
figure out the compound filter I am trying to accomplish.

Thank you for any help.
 
M

merjet

Regarding the second list, I can interpret "unique" in two ways. I
believe it would help if you provide an example of the pre-filtered
and post-filtered data.

Hth,
Merjet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top