How to read the LAST sheet in excel

2 次查看(过去 30 天)
Hi MATLAB experts,
I'd like to read the last sheet in excel spreadsheet. Although the sheet has a name, no matter what, I want to read the last sheet in the file.
Would you mind if I ask you to share your thoughts on this?
Thanks for your help. Jake
inputfolder = 'C:\Matlab\';
holdingfilename = [inputfolder,'prices.xls'];
sheet = 'random';
[numdata, txtdata] = xlsread(holdingfilename, sheet);

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2016-8-16
编辑:Azzi Abdelmalek 2016-8-16
To get the name of the last sheet use xlsfinfo
[~,name]=xlsfinfo('file.xlsx')
last_sheet=name{end}
N=xlsread('file.xlsx',last_sheet)

更多回答(0 个)

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by