Export data and Format Cells in Excel using Matlab using ActiveX
19 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'm exporting data to an excel file using ActiveX on Matlab and some of the data I'm exporting is in the format hh:mm:ss.sss. My data is supposed to be a quantity like 2 hours:45 minutes, not a time like 2PM, but excel automatically formats the cell and changes the numbers so that it's an AM/PM time. I can go into excel and change the cell formatting manually, but I would like this to be a one-step process because I'm processing lots of data. Is there a way to format individual cells to [hh:mm:ss.sss] using ActiveX while I'm writing to them or after I'm done writing data?
0 comentarios
Respuestas (1)
Guillaume
el 20 de Mzo. de 2018
You can format individual or multiple cells at once with the NumberFormat property of your Range object. Something similar to:
yourrange.NumberFormat('hh:mm:ss.00'); %hh:mm:ss.00 is the excel format corresponding to matlab hh:mm:ss.sss
0 comentarios
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!