Sort Worksheet by something by clicking on "explore"

Asked

Viewed 63 times

0

Good Afternoon everyone,

I am trying to filter a specific spreadsheet. The idea is to filter a spreadsheet by a subject. By clicking Explore.

Example "Worksheet to be automatically filtered"

inserir a descrição da imagem aqui

I put an ID in the column like trying to facilitate automatic sorting, "I’m thinking as if it were a querye I don’t know if there is a better alternative in excel"

I would then have another sheet with the following table

inserir a descrição da imagem aqui

This table represents in ascending order the ID’s [1,2,3,4] when I click for "Details" type brigadier, it would automatically take me to the main table already filtered

inserir a descrição da imagem aqui

I couldn’t build a formula for it, I’m open to suggestions.

  • I did not understand the need. It would not be simpler to filter by "Type" and then filter "Brigadier"?

  • For example by clicking on Details of Chocolates, it would filter the other table by code 1 which represents all Chocolate Cakes

  • Use the Autofilter with the VBA.

1 answer

0

I believe that the solution has two needs

  • Selection of the type of cake
  • Selected cake type filter

In relation to this, I attacked point 2. My proposal is an advanced filter.

Option Explicit

Sub FiltroAvançado()

    Dim rngBase As Range
    Dim rngCriterios As Range
    
    Set rngBase = Range("a1").CurrentRegion
    Set rngCriterios = Range("e1:g2")
       
    rngBase.AdvancedFilter xlFilterInPlace, rngCriterios


End Sub

What is inserted in E2, F2 or G2 will be used as a criterion for the filter. I could not reach a conclusion in meeting point 1.

Planilha

Browser other questions tagged

You are not signed in. Login or sign up in order to post.