I am having trouble filtering multiple columns while using (inserted) shapes as buttons. The code I am currently running will filter one column, however, when I go to filter another column, it unfilters the previously filtered column while filtering the newly selected column.
I would like to filter one column and then be able to filter another column on top if that next column, using a button feature.
Below is the code I use for each individual button. I obviously need to tie them all together, but I have noooooo idea how to do that. If you have any kind of input, it will be greatly appreciated!
Sub Auto()
Application.ScreenUpdating = False
If Range("D4").Value = 1 Then
ActiveSheet.Range("$A$7:$AZ$500").AutoFilter Field:="4"
Range("D4").Value = 0
Else
Range("A7:AZ500").AutoFilter
ActiveSheet.Range("$A$7:$AZ$500").AutoFilter Field:=4, Criteria1:= _
"Y", Operator:=xlFilterValues
Range("D4").Value = 1
Range("D4").Select
End If
Application.ScreenUpdating = True
End Sub
I would like to filter one column and then be able to filter another column on top if that next column, using a button feature.
Below is the code I use for each individual button. I obviously need to tie them all together, but I have noooooo idea how to do that. If you have any kind of input, it will be greatly appreciated!
Sub Auto()
Application.ScreenUpdating = False
If Range("D4").Value = 1 Then
ActiveSheet.Range("$A$7:$AZ$500").AutoFilter Field:="4"
Range("D4").Value = 0
Else
Range("A7:AZ500").AutoFilter
ActiveSheet.Range("$A$7:$AZ$500").AutoFilter Field:=4, Criteria1:= _
"Y", Operator:=xlFilterValues
Range("D4").Value = 1
Range("D4").Select
End If
Application.ScreenUpdating = True
End Sub