I have a lot of xlsm files to process.
Essentially I have a loop that searched for sheet name and column name that satisfies certain criteria and retrieve and store the sheet name and column, for example in a particular loop, perhaps,
SheetName = “1”; Col = “BH”;
Can I set these variable as options to readtable?

 採用された回答

Walter Roberson
Walter Roberson 2020 年 3 月 31 日

0 投票

Yes.
'sheet' and 'range' are both valid for "spreadsheet" (.xls, .xlsx) files

3 件のコメント

chlor thanks
chlor thanks 2020 年 3 月 31 日
What about xlsm files? Also do you have an example?
Walter Roberson
Walter Roberson 2020 年 3 月 31 日
Yes xlsm too.
Sheetname="1"; Col="BH" ;
readtable('YourFile.xlsm','sheet',Sheetname,'range',Col)
chlor thanks
chlor thanks 2020 年 4 月 7 日
Thank you! For col I used BH:BH

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by