필터 지우기
필터 지우기

How to merge cells in excel

조회 수: 98 (최근 30일)
Elysi Cochin
Elysi Cochin 2017년 4월 27일
댓글: Ricardo Gutierrez 2020년 6월 27일
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
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
KL 2017년 4월 27일
편집: KL 2017년 4월 27일
Check here .
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
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
Ricardo Gutierrez 2020년 6월 27일
Very good. But, if I want to save the file from matlab, how should I do it?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile 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!

Translated by