필터 지우기
필터 지우기

Set excel cell dimension.

조회 수: 35 (최근 30일)
Tommaso
Tommaso 2013년 10월 30일
댓글: Friedrich 2013년 10월 31일
Hi everybody, I need to know if it is possible, via matlab, to set excel cells dimensions (width and height) and if it is possible to turn on the option "text wrap".
Thanks

채택된 답변

Friedrich
Friedrich 2013년 10월 30일
Hi,
sure. Here you go:
ex = actxserver('excel.application');
ex.Workbooks.Add
ex.Visible = 1;
ex.Columns.Item('A:A').ColumnWidth = 30;
ex.Rows.Item('1:1').RowHeight = 60;
ex.Range('A1:A1').Select
ex.Selection.WrapText = true;
  댓글 수: 3
Tommaso
Tommaso 2013년 10월 30일
편집: Tommaso 2013년 10월 30일
May you tell me how to centre (both in width and height) the text written in the cell and how to add borders?
Thanks!!
Friedrich
Friedrich 2013년 10월 31일
Open Excel, Enable Macro recording and do what you like to do manually. Afterwards take a look at the generated VBA code. This shows what you need to do.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by