File Exchange

image thumbnail


version (2.43 KB) by Are Mjaavatten
Read selected columns from a large Excel file using ActiveX

1 Download

Updated 15 Mar 2016

View License

If you need to read one or mode columns of numeric data from a large Excel file, this will do it faster, and use less memory, than xlsread. Reads the same rows from all columns and returns an array. Non-numeric entries return NaNs. The columns need not be consecutive, and can be specified by letter code or number.

Cite As

Are Mjaavatten (2021). read_excel_columns(filename,sheet,columns,firstrow,lastrow) (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (4)

Michael Ullrich

Are Mjaavatten

Maen Hawamdeh: II don't know why you get this error. Maybe my code does not work with newer versions of Matlab or Excel? I cannot test this, as I use R1014b and Office 2010. Which error message do you get?

Maen Hawamdeh

hello, thank you for this code, but i have this error:

Error in read_excel_columns (line 55)
hWorkbook.Close(false); % Close without saving

This is faster than readtable() too ! Thanks :)

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: joukowski airfoil

Community Treasure Hunt

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

Start Hunting!