How to add/write multiple spreadsheets to a excel file from MATLAB?

1 回表示 (過去 30 日間)
Manish Shankar Neelgar
Manish Shankar Neelgar 2021 年 1 月 21 日
コメント済み: Mathieu NOE 2021 年 1 月 22 日
Hello Everyone,
Let's consider I have three spreadsheets named A1, A2, A3 and I wish to write these 3 spreadsheets to a single excel file in MATLAB. Could anyone please let me know How I can do it?
Thanks in advance.
  6 件のコメント
Manish Shankar Neelgar
Manish Shankar Neelgar 2021 年 1 月 22 日
I need the sheet name also to be same. I tweeked your code and got the perfect solution. Thank you for your help. It saved my time.
[~,sheet_name]=xlsfinfo('Test.xlsx')
for k=1:numel(sheet_name)
[~,~,data{k}]=xlsread('Test.xlsx',sheet_name{k});
writecell(data{k},'Result.xlsx','Sheet',sheet_name{k});
end
Mathieu NOE
Mathieu NOE 2021 年 1 月 22 日
you're welcome

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by