-2

I have some issue about Autofilter a range of cells on an Excel sheet.

the part of the code: vchWorkSheet:Range(XLS_col(1) + STRING(2) + ":" + XLS_col(vi_x) + STRING(2)):Autofilter.

where: XLS_col(1) - the actual column (for example: "A"), vchWorkSheet - the actual worksheet, Range(XLS_col(1) + STRING(2) + ":" + XLS_col(vi_x) + STRING(2)) - the range of cells (for example: "A2:BB2")

I've got an error message when building app: "Wrong number of parameters. Component method Autofilter called with < 3 parameters."

Actually I would like to use only VisibleDropDown parameter, nothing to filter in default.

Error message here

Any idea?

I've tried to add some parameters (for example: vchWorksheet:Range("A2:BB2"):Autofilter:VisibleDropDown = TRUE., or: vchWorksheet:Range("A2:BB2"):Autofilter(,,,,,TRUE).), but i don't know the syntax of Autofilter arguments.

I would like to display filter option on the range

Tom Bascom
  • 13,405
  • 2
  • 27
  • 33
  • Posting a small example of running code that produces the error would make it easier for people to help you. – Jensd Feb 02 '23 at 09:29
  • Welcome Szabó! Please take some time to read the introduction to Stack Overflow and earn your first badge. We're a little bit different from other sites. Here's how... https://stackoverflow.com/tour – user10186832 Feb 02 '23 at 09:42
  • Please provide enough code so others can better understand or reproduce the problem. – Community Feb 02 '23 at 22:34

2 Answers2

1

I tried to use vchWorksheet:Range("A2:BB2"):Autofilter(?,?,?). and it solved my problem, so I just used 3 null parameter (:Autofilter(?,?,?)) and now the filters are displayed on the range.

0

This is what I usually do:

    chWorksheet:Range("A1:W" + STRING(nTotalRows)):SELECT.
    chWorksheet:Range("A1:W" + STRING(nTotalRows)):AutoFilter("1",,).
Ezequiel
  • 75
  • 7