NamedRange::HorizontalAlignment Property
Gets or sets the horizontal alignment for the NamedRange control.
Assembly: Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
Some of the XlHAlign values might not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.
The following code example demonstrates how to set a variety of formatting and display characteristics of a NamedRange control named NamedRange1. In particular, this example sets the HorizontalAlignment property to xlHAlignCenter so that the contents of the range are centered horizontally within the bounds of each cell.
This example is for a document-level customization.
Show: