Edit

Share via


Range.Consolidate(Object, Object, Object, Object, Object) Method

Definition

Consolidates data from multiple ranges on multiple worksheets into a single range on a single worksheet.

public object Consolidate (object Sources, object Function, object TopRow, object LeftColumn, object CreateLinks);
Public Function Consolidate (Optional Sources As Object, Optional Function As Object, Optional TopRow As Object, Optional LeftColumn As Object, Optional CreateLinks As Object) As Object

Parameters

Sources
Object

Optional Object. The sources of the consolidation as an array of text reference strings in R1C1-style notation. The references must include the full path of sheets to be consolidated.

Function
Object

Optional XlConsolidationFunction. Can be one of the following XlConsilidationFunction constants:xlAveragedefaultxlCountxlCountNumsxlMaxxlMinxlProductxlStDevxlStDevPxlSumxlVarxlVarP

TopRow
Object

Optional Object. True to consolidate data based on column titles in the top row of the consolidation ranges; False to consolidate data by position. The default value is False.

LeftColumn
Object

Optional Object. True to consolidate data based on row titles in the left column of the consolidation ranges; False to consolidate data by position. The default value is False.

CreateLinks
Object

Optional Object. True to have the consolidation use worksheet links; False to have the consolidation copy the data. The default value is False.

Returns

Applies to