How to read the LAST sheet in excel

2 visualizaciones (últimos 30 días)
Jake
Jake el 16 de Ag. de 2016
Comentada: Jake el 17 de Ag. de 2016
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);

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 16 de Ag. de 2016
Editada: Azzi Abdelmalek el 16 de Ag. de 2016
To get the name of the last sheet use xlsfinfo
[~,name]=xlsfinfo('file.xlsx')
last_sheet=name{end}
N=xlsread('file.xlsx',last_sheet)
  1 comentario
Jake
Jake el 17 de Ag. de 2016
Thanks Azzi! That works perfect!!!

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by