Professional > Table scripting > Table presentation > Hiding rows, columns, and cells > Hiding cells
 
Hiding cells
Sample script file: HideRules.mrs
This example script is based on the Museum XML sample data set. See Running the sample table scripts.
You can hide individual cells in your tables where the values are equal to, above, or below a value that you specify. For example, you can hide cells containing zero, or containing values of less than 10.
The following script creates a table of museums by certificat, and hides any cells with values less than or equal to zero:
With Tables.AddNew("Table15", "museums * certificat", _
"Museum by qualification, hide any empty cells")
Set Rule = .Rules.AddNew()
Rule.Type = 0 ' hide
Rule.Target = 2 ' cell
Rule.CellItemRef = 0 ' if cellitem 0
Rule.Operator = 1 ' is less than or equal to
Rule.Value = 0 ' 0
End With
The Target parameter is set to 2 to specify that the hide rule applies to cells.
Here is the table produced by the script.
[
Note that when you hide cells, all the contents of each cell that meets the hide condition are removed, but the cell still remains on the table, even if all the cells in the row or column are blank.
See also
Hiding rows, columns, and cells