Advance Filtering

jabudhi

New Member
Joined
Jul 29, 2011
Messages
1
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.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,215,544
Messages
6,125,441
Members
449,225
Latest member
mparcado

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top