VBA to select filter criteria without deselecting current criteria

jlal1990

New Member
Joined
Jul 13, 2019
Messages
7
Hi guys,

I currently have a sheet with a column that has different filterable criteria (eg Education, How to, Gaming, Style, Film)

I recorded a macro to filter by the criteria 'Film' - however I dont know how to make it so that if I make another macro for 'Gaming', it will not deselect 'Film'. The aim is that i will have two macros - one for film and one for gaming , and if i click both macros - both filters will be applied. If i click one, only that one will be applied etc.

This is what i have so far:

Sub FILMfilter()


Sheets("Master Locator Data").Select
ActiveSheet.Range("$A$1:$AQ$30000").AUTOfilter Field:=9, Criteria1:= _
"Film"
Sheets("Functions").Select

End Sub

Thanks again!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
have you tried selecting on both in your macro recording ? its should produce and AND Criteria2:= _
"Gaming"
 
Upvote 0
Thanks for your help! I have but i dont want it to always return those 2 results, i would like it to be adaptive. I would essentially like it to perform the same function via macro as filtering and selecting new options whilst keeping others active each time.
 
Upvote 0
three macro buttons, or a marker to direct how the macro records
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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