How to merge cells in excel

25 visualizaciones (últimos 30 días)
Elysi Cochin
Elysi Cochin el 27 de Abr. de 2017
Comentada: 梓斌 el 2 de En. de 2025
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 comentario
king excel
king excel el 28 de Oct. de 2018
You can merge cells or rows or columns values easily using Dose for Excel Add-In: https://www.zbrainsoft.com/excel-merge.html

Iniciar sesión para comentar.

Respuesta aceptada

KL
KL el 27 de Abr. de 2017
Editada: KL el 27 de Abr. de 2017
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;
  5 comentarios
Ricardo Gutierrez
Ricardo Gutierrez el 27 de Jun. de 2020
Very good. But, if I want to save the file from matlab, how should I do it?
梓斌
梓斌 el 2 de En. de 2025
thanks for your tip。
where 'file' should be filename with fullpath. ('C:\file.xlsx')

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by