Microsoft Office Tutorials and References
In Depth Information
Figure 19-7. Sheet2 before consolidation
Function is the function used to combine the data. It can be one of the following
XlConsolidationFunction constants. (The default value is xlAverage .)
Enum XlConsolidationFunction
xlAverage = -4106
xlCount = -4112
xlCountNums = -4113
xlMax = -4136
xlMin = -4139
xlProduct = -4149
xlStDev = -4155
xlStDevP = -4156
xlSum = -4157
xlUnknown = 1000
xlVar = -4164
xlVarP = -4165
End Enum
TopRow should be set to True to consolidate the data based on column titles in the top row of the
consolidation ranges. Set the parameter to False (the default) to consolidate data by position. In
other words, if TopRow is True , Excel will combine columns with the same heading, even if they
are not in the same position.
LeftColumn should be set to True to consolidate the data based on row titles in the left column
of the consolidation ranges. Set the parameter to False (the default) to consolidate data by
position.
CreateLinks should be set to True to have the consolidation use worksheet links. Set the
parameter to False (the default) to have the consolidation copy the data.
To illustrate, consider the worksheets in Figure 19-7 a nd Figure 19-8 (note the order of the
columns).
Figure 19-7. Sheet2 before consolidation
Figure 19-8. Sheet3 before consolidation
The code:
Worksheets("Sheet1").Range("A1").Consolidate _
Sources:=Array("Sheet2!R1C1:R3C3", _
 
 
Search JabSto ::




Custom Search