Adding Data Already Existing Excel Sheets
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Onur ALPAY
el 5 de Mzo. de 2020
Comentada: darova
el 27 de Abr. de 2020
Hi,
I created an excel file nade "DATA". There are seven different sheets in it and the firs one is "PAGE1". My code gives numerical data at the end. I want put this data into a spesific row and colomn in the already excisting "DATA" file "PAGE1" sheet. How can I do that?
2 comentarios
darova
el 5 de Mzo. de 2020
Do you want to append data? Or you already know where to write (row and column)?
Respuesta aceptada
darova
el 5 de Mzo. de 2020
Try writematrix
writematrix(M,'Sample.xlsx','Sheet',1,'Range','D3:D6')
4 comentarios
Moh. Saadat
el 27 de Abr. de 2020
Hi, is there any way I can append a row to an existing excel sheet without explicitly specifying the 'Range'?
For instance, I already have:
1 2
5 1
and I need to add another row with [0 3]: instead of using
writematrix(filename, var, 'Range', 'A3:B3');
I want something like
writematrix(filename, var, 'append')
The problem with specifying 'Range' is that the number of columns I will have in my variable is not fixed; that's why specifying the range explicitly becomes more complicated than it should be.
Thanks in advance!
darova
el 27 de Abr. de 2020
There is no append option. You can only read the whole matrix
Try this
A = readmatrix('data.xlsx','sheet',1); % read the whole matrix
A = [A; 0 3]; % append data
writematrix('data.xlsx','sheet',1) % write new matrix
Más respuestas (1)
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!