Is it possible to increment the column range in a for loop before writing in excel?
5 views (last 30 days)
Show older comments
I guess it's easy with Matlab but I couldn't find any solution. Basically I have 67 files in excel, in each of them I have 1 column of numbers I want to copy in a single excel file i.e.:
file01.xls A1:A10 -----> copied in fileX.xls A1:A10
file02.xls A1:A10 -----> copied in fileX.xls B1:B10
file03.xls A1:A10 -----> copied in fileX.xls C1:C10
file03.xls A1:A10 -----> copied in fileX.xls D1:D10
I'm creating a for loop to read from xls files and write in fileX.xls but I don't know how to increment the letters of the range of fileX.xls
Any help?
Stefano
0 Comments
Accepted Answer
Image Analyst
on 17 Apr 2015
Yes, but unless you're willing to wait a very long time, you should not use xlswrite. You should use ActiveX, like in my attached demo.
And you might want to use a utility that converts the column number to the Excel column letter: http://www.mathworks.com/matlabcentral/fileexchange/15748-excel-column-number-to-column-name
0 Comments
More Answers (1)
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!