Alignment Property

Alignment returns or sets the horizontal alignment in worksheet cells. A null is returned if all the cells in a range do not have the same horizontal alignment. Returns a variant.

Syntax

object.Alignment

object.Alignment = Alignment

Parameter

Type

Description

Alignment

wksAlign

required

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.Alignment = wksAlignCenter

Used by: WksCellFormat object