How to paste cell values from multiple excel sheets?

Hi I have a problem. I have 1080 excel files named from '1' to '1080' and I would like to copy several values from each file to one master spreadsheet (the corresponding cells are the same in every file). I tried to use the 'get' command in a loop but I keep getting error mesages.
Can anyone help me by providing a sample code or example?
thank you in advance

답변 (1개)

per isakson
per isakson 2013년 4월 22일
Try
doc xlsread

댓글 수: 2

Thank you it worked just fine. There is one more thing I want to do. I would like to save all these values into 1Xi matrix. I am doing something wrong because I keep getting 'Subscripted assignment dimension mismatch.' error. If you could help me on this it would be perfect!!
per isakson
per isakson 2013년 4월 23일
편집: per isakson 2013년 4월 23일
You have to provide more detail.
Something like this will store all data
MAT = nan( n, m, 1080 ); % allocate memory
for ii = 1 : 1080
MAT( :, :, ii ) = xlsread( sprintf( 'filename%i.xls', ii ) );
end

댓글을 달려면 로그인하십시오.

카테고리

태그

질문:

2013년 4월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by