ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Advanced filter vba (https://www.excelbanter.com/excel-programming/385388-advanced-filter-vba.html)

[email protected]

Advanced filter vba
 
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.


merjet

Advanced filter vba
 
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




All times are GMT +1. The time now is 05:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com