xlsread merge & center and highlight in red
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (2)
Iain
am 13 Aug. 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 Kommentare
Ilyas
am 20 Okt. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!