Alignment Property [WksCellFormat]
The Alignment property returns or sets the horizontal alignment in worksheet cells. A null is returned if the cells in a range have the varying horizontal alignments. Returns a Variant.
Syntax
object.Alignment
object.Alignment = Alignment
Parameter | Type | Description |
Alignment | wksAlign | required, alignment type |
Example 1
This example demonstrates how to return the horizontal alignment of cells.
Debug.Print WksCellFormat.Alignment
Example 2
This example demonstrates how to center cell values.
WksCellFormat.wksAlignCenter
Used by: WksCellFormat object