Retrieve filter values

R0abin Posted messages 3 Status Member -  
R0abin Posted messages 3 Status Member -
Hello everyone,

I have been desperately trying for several days to find a solution to retrieve the values of a filter. See photo below.


I would like to retrieve the values framed in red. Do you know if it is possible? After searching without finding the solution, I am starting to wonder.

Thank you for your help,

2 answers

  1. yg_be Posted messages 23437 Registration date   Status Contributor Last intervention   Ambassador 1 588
     
    Hello,
    "retrieve": where, for what purpose?
    0
    1. yg_be Posted messages 23437 Registration date   Status Contributor Last intervention   1 588
       

      Dim fl As Worksheet, ft As Filter, sv Set fl = ActiveSheet For Each ft In fl.AutoFilter.Filters For Each sv In ft.Criteria1 Debug.Print sv Next sv Next ft
      0
    2. R0abin Posted messages 3 Status Member
       
      Hello yg_be,

      I want to retrieve these criteria to put them in a combo box, and the only option I've found so far is to read all the lines of my file and produce a list without duplicates, which is a bit of a brutal solution...

      I will test your solution, thanks!
      0
      1. yg_be Posted messages 23437 Registration date   Status Contributor Last intervention   1 588 > R0abin Posted messages 3 Status Member
         
        if you have many different values, the criteria list will only retrieve part of them.
        I think it's better to use the "brutal" method.
        0
  2. R0abin Posted messages 3 Status Member
     
    I couldn't get your code to work.

    Unfortunately, I realize that the application I want to create is much better suited to a database structure, and that exceeds my skills.
    0