HotXLS Docs

Unmerge method

Separates a merged area into individual cells.

Syntax

procedure UnMerge;

Example

This example checks the heading area, unmerges it, and then writes separate labels into the cells that used to be part of the merged range.

var
  Heading: IXLSRange;
begin
  Heading := Workbook.Sheets[1].Range['A1', 'F2'];

  if Heading.MergeCells then
    Heading.UnMerge;

  Workbook.Sheets[1].Range['A1', 'A1'].Value := 'Region';
  Workbook.Sheets[1].Range['B1', 'B1'].Value := 'Amount';
end;

See also