Advanced filter to hide records using a formula

bensko

Board Regular
Joined
Mar 4, 2008
Messages
173
I'm using the following formula to count multiple instances of a customer as 1, but how could I use something similar to hide all instances of a customer if one of the rows in a different column meets a certain criteria.

Code:
SUM(IF(FREQUENCY(MATCH(AM9:AM986,AM9:AM986,0),MATCH(AM9:AM986,AM9:AM986,0))>0

Column C lists 978 equipment installation project numbers.

Column H is a lookup formula that if a parts order has been placed against that project in the past year, the cell shows "< 1year"

Column K are dates that indicate when we have made the last sales call with that customer

Column AM lists 511 unique customers (more than 1 project was done for several customers)

I'm currently using the following code to hide projects where they have either placed an order with us, or we have made a sales call to that customer in the past year.

Code:
Sub ACTIVE_CUST_FILTER()
    Selection.AutoFilter Field:=8, Criteria1:="<>< 1year", Operator:=xlAnd
    Selection.AutoFilter Field:=9, Criteria1:="OPERATING"
    Selection.AutoFilter Field:=11, Criteria1:=">7/23/2008", Operator:=xlAnd
End Sub

I would like the filter to hide all instances/rows of a customer if an order had been placed against 1(or more) projects for that customer. In other words if we have 3 systems for the same customer and they buy parts for one of the systems, I would like all 3 rows to hide.

Would also be nice if someone makes a sales call to a customer and forgets to place the call date in all instances for that customer, the filter is applied to all instances. This one is not a big deal as I try to monitor the workbook for these types of oversights...

Also How can I change (Selection.AutoFilter Field:=11, Criteria1:=">7/23/2008") to >today()-365? can't seem to get that to work?

Thanks for any help in advance,

Ben
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,215,054
Messages
6,122,897
Members
449,097
Latest member
dbomb1414

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