Attached is a small portion of the table Which has 100's nay 1000's of lines,and i need a way to filter direct from VBA "USERFORM".
This works to filter just 1 Column (Granted more than 3 options to choose from, but I only need 3 of the options to sort through)
(Promo Choice)
This works if I change a particular cell via worksheet change for (Item)
This works for Price code, which has muti-options as well
What I need is a way to do all of these via VBA, and keep filters as they go, for example If I choose (per image) Item = AAOY, Promo Choice = 2Y, and Price Code = USA , the end result will filter to Only show AAOY 2Y USA Items. When ever i try to do this, it only does 1 at a time I can't narrow it down... IE if i select AAOY it'll show all AAOY Options, but then if I choose 2Y it now shows ALL Journals that have 2Y vs just showing all AAOY 2Y options.
With 1000's of lines I need filters to narrow down without me having to use the sheet itself.
Sample of what I am trying to attempt, but keep getting errors
This works to filter just 1 Column (Granted more than 3 options to choose from, but I only need 3 of the options to sort through)
(Promo Choice)
VBA Code:
Sub Promo_Choice_1_2_3()
Worksheets("Rates").Range("$A$1:$L$280242").AutoFilter Field:=4, Criteria1:=Array( _
"1Y", "2Y", "3Y"), Operator:=xlFilterValues
End Sub
This works if I change a particular cell via worksheet change for (Item)
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice 20160606
If Target.Address = Range("N2").Address Then
Range("$A$1:$L$280242").CurrentRegion.AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=Range("N1:N2")
End If
End Sub
This works for Price code, which has muti-options as well
VBA Code:
Sub Price_Code_Combo()
Worksheets("Rates").Range("$A$1:$L$280242").AutoFilter Field:=7, Criteria1:=Array( _
"USA", "Canada", "Mexico"), Operator:=xlFilterValues
End Sub
What I need is a way to do all of these via VBA, and keep filters as they go, for example If I choose (per image) Item = AAOY, Promo Choice = 2Y, and Price Code = USA , the end result will filter to Only show AAOY 2Y USA Items. When ever i try to do this, it only does 1 at a time I can't narrow it down... IE if i select AAOY it'll show all AAOY Options, but then if I choose 2Y it now shows ALL Journals that have 2Y vs just showing all AAOY 2Y options.
With 1000's of lines I need filters to narrow down without me having to use the sheet itself.
Sample of what I am trying to attempt, but keep getting errors
VBA Code:
Private Sub ComboBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Worksheets("Rates").Range("N2") = Me.ComboBox1.Value
Worksheets("Rates").Range("$A$1:$L$280242").AutoFilter Field:=2, Criteria1:=Array(Worksheets("Rates").Range("N2")), Operator:=xlFilterValues
End Sub