Hi Everyone,
I am stuck with writing multiple Excel sheets into one Excel file. I have 31 sheets contained 1 Excel workbook and successfully imported them with " readtable" function with the help of for loop of of course.
However, when I try to add them horizontally and create a single workbook, it seems impossible. I have just wrote a simple function to do that task as follows:
function sheetss(filename,portion)
sheets = sheetnames(filename);
T = cell(1,31);
for i = 1:31
T{i} = readtable(filename,'Sheet', sheets{i},'Range',portion);
end
table(T{:});
writetable(T,'Result.xlsx')
0 Comments
Sign in to comment.