about write data to the first sheet of excel
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
wenchao zhang
el 1 de Jul. de 2024
Comentada: wenchao zhang
el 1 de Jul. de 2024
hello, i want wrtie specific data to several sheet of the excel, and i have named each sheet, but i find may new target sheet will added after sheet1, how i can replace sheet1
0 comentarios
Respuesta aceptada
Abhishek Kumar Singh
el 1 de Jul. de 2024
I suppose you want to write some data to a specific sheet, here's a sample code you can refer to, which also doesn't creates or adds any new sheet:
% Create a sample table
data = table([1; 2; 3], [4; 5; 6], 'VariableNames', {'Column1', 'Column2'});
% Write the table to a specific sheet in an Excel file
filename = 'testBook.xlsx';
sheet = 'mySheet';
writetable(data, filename, 'Sheet', sheet);
This is what I got:
Hope it helps!
2 comentarios
Más respuestas (0)
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!