Forum Discussion

Dean_T-B's avatar
Dean_T-B
Copper Contributor
Jul 30, 2022
Solved

Filter Non-Adjacent Columns

Is it possible to use the filer function for columns that aren't right next to each other? I don't want all the arrows across the whole table, only in 2 collums. I would prefer not using VBA but any help is appreciated.

  • Dean_T-B 

    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.

  • dscheikey's avatar
    dscheikey
    Bronze Contributor

    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.

    • Dean_T-B's avatar
      Dean_T-B
      Copper Contributor

      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.

       

      • Dean_T-B 

        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.

Resources