Is it possible to use xlsread for multiple ranges ??
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Image Analyst
le 17 Mar 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.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur ActiveX dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!