CenterHorizontally Property

CenterHorizontally returns or sets the horizontal centering of the page setup for the worksheet. It has a Boolean value. If this value is set to 'True', the printout is centered horizontally. If it is set to 'False', worksheet prints in the upper left corner of the page.

Syntax

object.CenterHorizontally

object. CenterHorizontally = HCenter

Parameter

Type

Description

HCenter

Boolean

required

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