Hi,
Columns A:G in my spreadsheet contain "Yes" or can be blank and there may be rows where there is more than one "Yes".
I have a dropdown in cell K2 where I can select the names of one of these columns and then I want to filter the data based on that column.
There's probably a better way, but this works - kind of!
So starting from scratch, if I select "Adult and Specialtist Rehabilitation", then column A is correctly filtered. But then if select "Adult Community", it filters it to rows where column A and B both contain "Yes"
So how should I reset in between these lines?
Columns A:G in my spreadsheet contain "Yes" or can be blank and there may be rows where there is more than one "Yes".
I have a dropdown in cell K2 where I can select the names of one of these columns and then I want to filter the data based on that column.
There's probably a better way, but this works - kind of!
Code:
If Range("K2").Value = "Adult and Specialtist Rehabilitation" Then ActiveSheet.Range("$A$1:$AA$10001").AutoFilter Field:=1, Criteria1:="Yes"
If Range("K2").Value = "Adult Community" Then ActiveSheet.Range("$A$1:$AA$10001").AutoFilter Field:=2, Criteria1:="Yes"
If Range("K2").Value = "Children and Families" Then ActiveSheet.Range("$A$1:$AA$10001").AutoFilter Field:=3, Criteria1:="Yes"
If Range("K2").Value = "Corporate and Other" Then ActiveSheet.Range("$A$1:$AA$10001").AutoFilter Field:=4, Criteria1:="Yes"
If Range("K2").Value = "Dental" Then ActiveSheet.Range("$A$1:$AA$10001").AutoFilter Field:=5, Criteria1:="Yes"
If Range("K2").Value = "Learning Disability" Then ActiveSheet.Range("$A$1:$AA$10001").AutoFilter Field:=6, Criteria1:="Yes"
If Range("K2").Value = "Tooth and Tissue Bank" Then ActiveSheet.Range("$A$1:$AA$10001").AutoFilter Field:=7, Criteria1:="Yes"
So starting from scratch, if I select "Adult and Specialtist Rehabilitation", then column A is correctly filtered. But then if select "Adult Community", it filters it to rows where column A and B both contain "Yes"
So how should I reset in between these lines?