Writes data to multiple ranges of existing Excel file.


Updated 15 Oct 2004

View License

Uses ActiveX commands to write data_n into range_n in an existing Excel spreadsheet. Inputs (excluding fileloc and promptforsave) must be paired.

As of 10/04 update, you may provide the target range (upper left cell to lower right cell) OR just the upper right cell. If the range is specified, the function will verify that the corresponding data block is the correct size, and give an error if not. (This may be useful for error checking, for instance.) If only the upper left cell is provided, write2excel will now compute the target range.

Additionally, you may now specify cells by address (eg., 'H3') OR row, column (eg, '[3,8]').

SEE ALSO: readfromexcel

Cite As

Brett Shoelson (2023). write2excel (https://www.mathworks.com/matlabcentral/fileexchange/4414-write2excel), MATLAB Central File Exchange. Retrieved .

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

Inspired: MATLAB read/write/control Excel, MAT2XLS v2.0

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

Recently modified version accidentally had changes incorporated into an old version. This version should now work properly.