Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

XL.Sheet.DelMergeByIndex

Removes merged cells by index.

Component Version macOS Windows Linux Server iOS SDK
XL 4.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "XL.Sheet.DelMergeByIndex"; bookRef; sheetIndex; index )   More

Parameters

Parameter Description Example
bookRef The reference to the workbook. Please use XL.LoadBook to load a file. $ref
sheetIndex The index of the sheet. This number ranges from 0 to XL.Book.SheetCount-1. 0
index The index of the hyperlink. From 0 to XL.Sheet.MergeSize-1. 0

Result

Returns OK or error.

Description

Removes merged cells by index.

Examples

Try the delete merge function:

# check how many we have
Show Custom Dialog [ "Merge count" ; MBS( "XL.Sheet.MergeSize"; $bookRef; 0 ) ]
# where is first one?
Set Variable [ $FirstMergeRowFirst ; Value: MBS( "XL.Sheet.Merge"; $bookRef; $sheet; 0; "RowFirst" ) ]
Set Variable [ $FirstMergeColFirst ; Value: MBS( "XL.Sheet.Merge"; $bookRef; $sheet; 0; "ColFirst" ) ]
Show Custom Dialog [ "First merge at" ; $FirstMergeRowFirst & " " & $FirstMergeColFirst ]
# now delete first in line
Set Variable [ $r ; Value: MBS( "XL.Sheet.DelMergeByIndex"; $bookRef; $sheet; 0 ) ]
# new count is lower
Show Custom Dialog [ "Merge count" ; MBS( "XL.Sheet.MergeSize"; $bookRef; 0 ) ]
# and this is now the next one
Set Variable [ $FirstMergeRowFirst ; Value: MBS( "XL.Sheet.Merge"; $bookRef; $sheet; 0; "RowFirst" ) ]
Set Variable [ $FirstMergeColFirst ; Value: MBS( "XL.Sheet.Merge"; $bookRef; $sheet; 0; "ColFirst" ) ]
Show Custom Dialog [ "First merge at" ; $FirstMergeRowFirst & " " & $FirstMergeColFirst ]

See also

This function checks for a license.

Created 18th August 2014, last changed 10th May 2023


XL.Sheet.DelHyperlink - XL.Sheet.DeleteMerge