How to merge cells in excel
조회 수: 98 (최근 30일)
이전 댓글 표시
I want to merge cells A1 to E1... and give a heading with different colour and font... how to do it through matlab code....
댓글 수: 1
king excel
2018년 10월 28일
You can merge cells or rows or columns values easily using Dose for Excel Add-In: https://www.zbrainsoft.com/excel-merge.html
채택된 답변
KL
2017년 4월 27일
편집: KL
2017년 4월 27일
e = actxserver('Excel.Application');
% Add a workbook.
eWorkbook = e.Workbooks.Add;
e.Visible = 1;
% Make the first sheet active.
eSheets = e.ActiveWorkbook.Sheets;
eSheet1 = eSheets.get('Item',1);
eSheet1.Activate
% Merge Cells
eSheet1 = eSheet1.get('Range', 'A1:E1');
eSheet1.MergeCells = 1;
eSheet1.Value = 'text here';
eSheet1.Font.ColorIndex = 3
eSheet1.Font.Bold = 1;
댓글 수: 4
KL
2017년 4월 27일
then you have to change
eWorkbook = e.Workbooks.Add;
to
eWorkbook = e.Workbooks.Open(file);
where 'file' should be filename with fullpath. ('C:\file.xlsx')
Ricardo Gutierrez
2020년 6월 27일
Very good. But, if I want to save the file from matlab, how should I do it?
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Use COM Objects in MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!