CustomViews.Add method (Excel)

Creates a new custom view.

Syntax

expression.Add (ViewName, PrintSettings, RowColSettings)

expression A variable that represents a CustomViews object.

Parameters

Name Required/Optional Data type Description
ViewName Required String The name of the new view.
PrintSettings Optional Variant True to include print settings in the custom view.
RowColSettings Optional Variant True to include settings for hidden rows and columns (including filter information) in the custom view.

Return value

A CustomView object that represents the new custom view.

Example

This example creates a new custom view named Summary in the active workbook.

ActiveWorkbook.CustomViews.Add "Summary", True, True

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.