How can I add a specific autofilter on a column in the excel file

8 ビュー (過去 30 日間)
Sweet Potato
Sweet Potato 2018 年 2 月 14 日
回答済み: Pruthvi G 2020 年 11 月 17 日
Hello everyone,
I am trying to apply filter on a specific column in the excel sheet using Matlab.
For example, I have a 10x10 table, with column J contain 2 values: "true or false", I want to filter column J so that it only shows all the rows that contain 'true' value on column J. I recorded a macro on excel, and this was VBA code that I got, but I haven't found a way to make it works in Matlab.
ActiveSheet.Range("$A$1:$J$10").AutoFilter Field:=10, Criteria1:="True"
Thank you for all your help.

回答 (1 件)

Pruthvi G
Pruthvi G 2020 年 11 月 17 日
ActiveSheet.Range('10:10').AutoFilter
invoke(ActiveSheet.Range('A1:J10'), 'AutoFilter', 10,... %Field
{'True'},... %Criteria1
7); %operator = xlFilterValues

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by