I got a sample file from contextures.com (http://contextures.com/ProductsList.zip) and it does what I need it to do, but instead of only having one set of criteria, I need to specify 3 sets of criteria in which the record will have before returning results. First of all, I'm a rookie at VBA scripting and am currently watching tutorials on how to make this work.
Here's my situation:
I have 3 drop-downs:
Year, Period, Company
All 3 of these criteria must be met before a specific row in the table is returned. I can do this with an advanced filter by selecting the table, the criteria and where the results will go, but I have to re-do the advanced filter each time and it won't dynamically change when I change the criteria.
Here's the contextures VBA code that works perfectly, but for only one set of criteria:
' Developed by Contextures Inc.
' www.contextures.com
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 3 And Target.Column = 3 Then
'calculate criteria cell in case calculation mode is manual
Worksheets("ProductsList").Range("G2").Calculate
Worksheets("ProductsList").Range("Database") _
.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("ProductsList").Range("G1:G2"), _
CopyToRange:=Range("A6:D6"), Unique:=False
End If
End Sub
Any suggestions as to how I can modify the contextures file to fit my needs? Sorry if I didn't give enough information. Thank You.
Here's my situation:
I have 3 drop-downs:
Year, Period, Company
All 3 of these criteria must be met before a specific row in the table is returned. I can do this with an advanced filter by selecting the table, the criteria and where the results will go, but I have to re-do the advanced filter each time and it won't dynamically change when I change the criteria.
Here's the contextures VBA code that works perfectly, but for only one set of criteria:
' Developed by Contextures Inc.
' www.contextures.com
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 3 And Target.Column = 3 Then
'calculate criteria cell in case calculation mode is manual
Worksheets("ProductsList").Range("G2").Calculate
Worksheets("ProductsList").Range("Database") _
.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("ProductsList").Range("G1:G2"), _
CopyToRange:=Range("A6:D6"), Unique:=False
End If
End Sub
Any suggestions as to how I can modify the contextures file to fit my needs? Sorry if I didn't give enough information. Thank You.