Forum Discussion
Filter Non-Adjacent Columns
- Jul 31, 2022
Let's say the table is named Table1.
Press Alt+F11 to activate the Visual Basic Editor.
Press Ctrl+G to activate the Immediate window in the Visual Basic Editor.
Type or copy/paste the following line:
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=2, VisibleDropdown:=False
With the insertion point anywhere in that line, press Enter.
Hi Dean_T-B,
as you can see no one has answered so far. I would think that's because no one really understands your question. Neither do I. Maybe you can make an example and explain exactly what you want. There is no filet function at all. Is this a translation problem? What does this have to do with arrows? You would have to describe in much more detail what you want. Does not work like that.
Hi dscheikey ,
Apologies for the typo, I was asking about the "Filter" function found in the "Data" tab.
I am attempting to apply the drop-down filter menus to two non-adjacent columns in the same table.
Please see the below example of what i am trying to achieve.
- HansVogelaarJul 31, 2022MVP
Let's say the table is named Table1.
Press Alt+F11 to activate the Visual Basic Editor.
Press Ctrl+G to activate the Immediate window in the Visual Basic Editor.
Type or copy/paste the following line:
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=2, VisibleDropdown:=False
With the insertion point anywhere in that line, press Enter.
- Dean_T-BJul 31, 2022Copper Contributor
Thanks HansVogelaar, that worked perfectly. Is there a way to do this if my data is not in a table? I have a much bigger spreadsheet I'd like to do this for as well.
- HansVogelaarJul 31, 2022MVP
Yes: instead of ActiveSheet.ListObjects("Table1").Range specify the range it applies to, for example Range("A1:T100")