kathleen0927
New Member
- Joined
- Feb 7, 2018
- Messages
- 32
Hi!
I have an Excel spreadsheet where I have added macros attached to control buttons to filter the 1825 row list based on discipline criteria. See code below for 1 example. I also have a macro that hides rows that have a value in them (to hide rows where the item is closed - "C" in the cell means closed and the code will only allow blanks). My problem is if you chose 1 of the discipline filter first, then select the macro to hide the closed, all rows are hidden. How can I change the "closed" code to filter the list AFTER another filter has been selected?
Sample Discipline Filter Code:
Hide Closed Item Filter Code:
I have an Excel spreadsheet where I have added macros attached to control buttons to filter the 1825 row list based on discipline criteria. See code below for 1 example. I also have a macro that hides rows that have a value in them (to hide rows where the item is closed - "C" in the cell means closed and the code will only allow blanks). My problem is if you chose 1 of the discipline filter first, then select the macro to hide the closed, all rows are hidden. How can I change the "closed" code to filter the list AFTER another filter has been selected?
Sample Discipline Filter Code:
Code:
Sub Construction_Click()
ActiveSheet.Unprotect Password:="OVA"
Range("a12:a1825").AutoFilter Field:=1, Criteria1:="HO"
Range("$e$4").Value = "Filter: Construction"
ActiveSheet.Protect Password:="OVA"
End Sub
Hide Closed Item Filter Code:
Code:
Sub HideClosed_Click()
ActiveSheet.Unprotect Password:="OVA"
Range("d13:d1825").AutoFilter Field:=1, Criteria1:=""
Range("$e$4").Value = "ALL (Active Awards Only)"
ActiveSheet.Protect Password:="OVA"
End Sub
Last edited by a moderator: