I am doing a new macro where I use autofilters. My program needs to read all columns and detect those where is written "Inspecc. tornillo" or ""caracterización exfoliación". I mean, the macro has to work with different excels where you don't know the order of the columns, you just know that one of them will have the name "caracterización exfoliación" and so on. So I tried to use Autofilter in this way:
ActiveSheet.Range(Cells(1, 1), Cells(nFilas, nColumnas)).AutoFilter
**Field:=tornillo**, Criteria1:="=Inspeccionar", Operator:=xlOr, Criteria2:="=No"
Instead of:
> ActiveSheet.Range(Cells(1, 1), Cells(nFilas, nColumnas)).AutoFilter
> **Field:=7**, Criteria1:="=Inspeccionar", Operator:=xlOr, Criteria2:="=No"
I declared the variable tornillo as variant, but it doesn't work. How could I do?
Thanks in advance
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.