Is it possible to use xlsread for multiple ranges ??
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Alejandro
am 17 Mär. 2015
Kommentiert: Alejandro
am 17 Mär. 2015
I hope there's an easy answer to this, I'm trying to import some data from a single excel file and also same sheet, but it is not ordered consecutively, so what I did was this:
myRange = get(handles.listbox1,'Value');
myCells = sprintf('AF%d:AF%d',myRange+1, myRange+1);
BTF = xlsread('Section.xls', 1, myCells);
myCells2 = sprintf('AH%d:AH%d',myRange+1, myRange+1);
HTW = xlsread('Section.xls', 1, myCells2);
myCells3 = sprintf('AL%d:AL%d',myRange+1, myRange+1);
ZX = xlsread('Section.xls', 1, myCells3);
myCells4 = sprintf('AR%d:AR%d',myRange+1, myRange+1);
RY = xlsread('Section.xls', 1, myCells4);
myCells5 = sprintf('AU%d:AU%d',myRange+1, myRange+1);
JJ = xlsread('Section.xls', 1, myCells5);
myCells6 = sprintf('AV%d:AV%d',myRange+1, myRange+1);
CW = xlsread('Section.xls', 1, myCells6);
This takes too much time to process and I still need to import more ranges. Any Ideas anyone??
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 17 Mär. 2015
Yes that will take a very long time. What you need to do is to use ActiveX so that you only launch and shutdown Excel once instead of 7 times. See my attached demo.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu ActiveX finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!