xlsread merge & center and highlight in red
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (2 件)
Iain
2014 年 8 月 13 日
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 件のコメント
Ilyas
2014 年 10 月 20 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!