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 the page horizontally

 

Example 1

This example demonstrates how to return whether or not worksheet contents will be 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