xlsread merge & center and highlight in red
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I am writing an xlswrite file and I want to write a header before I imput my date. I want to know if I can write a command to Merge & Center text in a specific line of the file. For example, I want to write a file that merges 'Title' from A1 to I1. Can I do this in MATLAB?
I would also like to write in the excel file an array that is written in red font. How do I do this? I wasn't sure what to ask the help search results to learn how to do this myself.
--Ender--
0 comentarios
Respuestas (2)
Iain
el 13 de Ag. de 2014
Ok, theres three things you have to do:
1. Determine the visual basic code that excel uses to achieve that. Record a macro or whatever to get the code.
2. View the matlab code for xlsread & xlswrite to learn a bit about how matlab uses visual basic commands to control excel via activeX.
3. Put the two together.
0 comentarios
Ilyas
el 20 de Oct. de 2014
True = 1;
False = 0;
xlCenter = -4108;
excelOutputFileName = 'full path\excelfile.xlsx'
Excel = actxserver('Excel.Application');
Excel.Visible = 0; % to see the excel file real time make 1;
Workbook = Excel.Workbooks.Open(excelOutputFileName);
Range = Excel.Range('A1:I1');
Range.Select;
Range.MergeCells = True;
Range.HorizontalAlignment = xlCenter;
0 comentarios
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!