CenterHorizontally Property

The CenterHorizontally property returns or sets the horizontal centering of the worksheet page setup. Returns a Boolean.

Syntax

object.CenterHorizontally

object.CenterHorizontally = HCenter

 

Parameter Type Description
HCenter Boolean required, true to center horizontally

 

Example 1

This example demonstrates how to return whether or not worksheet contents are centered horizontally when printed.

Debug.Print WksPageSetup.CenterHorizontally

Example 2

This example demonstrates how to horizontally center worksheet contents to be printed.

WksPageSetup.CenterHorizontally = True

 

Used by: WksPageSetup object