CenterHeader Property

Microsoft Excel Visual Basic

Returns or sets the center part of the header. Read/write String.

Remarks

Special format codes can be used in the header text.

Example

This example prints the date and page number at the top of each page.

Worksheets("Sheet1").PageSetup.CenterHeader = "&D page &P of &N"