David Schaleger
Board Regular
- Joined
- Dec 6, 2010
- Messages
- 55
I need VBA code to toggle specific filtering in one field of a table on and off.
I have a table where, in one field, I'm often toggling between the same specific criteria (let's say Crit1, Crit2 and Blanks) and clearing all filtering. If the filter criteria are not applied, then they need to be applied (and autofiltering turned on if it's not), and if they are applied, then all of the filtering for that field needs to be cleared (other field's filterings can remain, and autofiltering can remain on).
I've tried several examples, but all seem to pertain to non-table filtering; the fact that it's in a table seems to be trumping me up. I'd like to reference the filtered field by table/field name, rather than table/field index number, so that the code will work if fields are added, deleted, or moved.
Thank you
I have a table where, in one field, I'm often toggling between the same specific criteria (let's say Crit1, Crit2 and Blanks) and clearing all filtering. If the filter criteria are not applied, then they need to be applied (and autofiltering turned on if it's not), and if they are applied, then all of the filtering for that field needs to be cleared (other field's filterings can remain, and autofiltering can remain on).
I've tried several examples, but all seem to pertain to non-table filtering; the fact that it's in a table seems to be trumping me up. I'd like to reference the filtered field by table/field name, rather than table/field index number, so that the code will work if fields are added, deleted, or moved.
Thank you
Last edited: