Multiple Column Filtering Marco

Kasey_

New Member
Joined
Sep 23, 2011
Messages
4
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
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,224,583
Messages
6,179,673
Members
452,937
Latest member
Bhg1984

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