Microsoft Office Tutorials and References
In Depth Information
19.3.29 FormulaHidden Property (R/W Boolean)
=A1:C3 + A5:C7
19.3.29 FormulaHidden Property (R/W Boolean)
This property returns or sets the Hidden state ( True or False ) for the formula in the cell to
which it is applied. This is equivalent to setting the Hidden check box in the Protection tab of the
Format Cells dialog.
Note that this is not the same as the Hidden property, which applies to ranges that consist of entire
rows (or entire columns) and determines whether or not those rows (or columns) are hidden from
19.3.30 HasFormula Property (Read-Only)
This property returns True if all cells in the range contain formulas; it returns False if none of
the cells in the range contains a formula and Null otherwise.
19.3.31 HorizontalAlignment Property
The HorizontalAlignment property returns or sets the horizontal alignment of all cells in the range.
The value can be one of the following constants:
Enum XlHAlign
xlHAlignRight = -4152
xlHAlignLeft = -4131
xlHAlignJustify = -4130
xlHAlignDistributed = -4117 'for Far East Excel
xlHAlignCenter = -4108
xlHAlignGeneral = 1
xlHAlignFill = 5
xlHAlignCenterAcrossSelection = 7
End Enum
Note especially the xlHAlignCenterAcrossSelection constant, which is very useful for
aligning a title across multiple cells.
19.3.32 IndentLevel Property and InsertIndent Method
The IndentLevel property returns or sets the left indent for each cell in the range and can be any
integer between 0 and 15. All other settings cause an error. Presumably, indents are useful for
aligning the contents of cells or for formatting text.
For instance, to set the indent level of cell A1 to 10, we can write:
Range("A1").IndentLevel = 10
Unfortunately, the documentation does not specify how big an indent unit is, but we can still use
indent units in a relative way. Presumably, an indent level of 2 is twice that of an indent level of 1.
An alternative is to use the InsertIndent method, with the syntax:
RangeObject .InsertIndent( InsertAmount )
Search JabSto ::

Custom Search