MergeCells Property
Returns or sets a value that determines whether a cell that contains the same content should be grouped across multiple rows or columns in a single cell.
Grammar
Object. MergeCells [=value]
The syntax for the MergeCells property contains the following sections:
Part |
Description |
Object |
An object expression whose value is an object in the Applies To list. |
Value |
An integer or constant that specifies the unit grouping (merge). As specified in the set value. |
Setting Values
The value setting is shown as follows:
Constants |
value |
Description |
Flexmergenever |
0 |
Not displayed. Cells that contain the same content are not grouped. This is the default setting. |
Flexmergefree |
1 |
Free. Cells that contain the same content are always merged. |
flexmergerestrictrows |
2 |
Limit rows. Only adjacent cells that contain the same content in a row (to the left of the current cell) are merged. |
Flexmergerestrictcolumns |
3 |
Restrict columns. Only adjacent cells that contain the same content in the column (above the current cell) are merged. |
Flexmergerestrictboth |
4 |
Restrict rows and columns. Only cells that contain the same content in a row (left) or in a column (up) are merged. |
Description
The ability to merge cells allows you to display data in a clear, concise way. You can combine the use of cells with a sort and mshflexgrid column function.
To use the MSHFlexGrid unit merge capability : set the mergecells to a value other than 0. (The difference between setting values is explained in the example.) )
Set the array property of Mergerow and mergecol to Truefor rows and columns to be merged.
When you use unit consolidation capabilities,MSHFlexGrid merges cells that contain the same content. Whenever the contents of a cell change, the merge is automatically updated.
When MergeCells is set to a value other than 0 (not shown), the highlighted selection is automatically closed. This is done to accelerate the redraw, but also because the selection that contains the range of merged cells can lead to unpredictable results.
Mergecol, Mergerow properties
Returns or sets a value that determines which rows and columns can merge their contents. To use the MergeCells property, these properties must be True.
Grammar
Object. Mergecol (number) [=boolean]
Object. Mergerow (number) [=boolean]
The syntax for the mergecol and mergerows properties consists of the following sections:
Part |
Description |
Object |
An object expression whose value is an object in the Applies To list. |
Number |
A Long value that specifies the column or row in the MSHFlexGrid . |
Boolean |
A Boolean value that specifies whether the merge occurs when the adjacent cells display the same content. |
Setting Values
The Boolean setting values are as follows:
Part |
Description |
True |
When adjacent cells display the same content, the rows are merged to the left or the columns are merged upward. |
False |
When adjacent cells display the same content, the cells are not merged. This is the default set value for mergecol and mergerow . |
Description
If the MergeCells property is set to a value other than 0, adjacent cells with the same value, only they are on one line and the Mergerow property is set to True, or all are in a column and Mergecol Merge When the property is set to True .
For more information about the merge features of MSHFlexGrid , see mergecells properties.