Bewerken

Delen via


Worksheet.ConsolidationOptions property (Excel)

Returns a three-element array of consolidation options, as shown in the following table. If the element is True, that option is set. Read-only Variant.

Syntax

expression.ConsolidationOptions

expression A variable that represents a Worksheet object.

Remarks

Element Description
1 Use labels in top row.
2 Use labels in left column.
3 Create links to source data.

Example

This example displays the consolidation options for Sheet1. The list appears on a new worksheet created by the example.

Set newSheet = Worksheets.Add 
aOptions = Worksheets("Sheet1").ConsolidationOptions 
newSheet.Range("A1").Value = "Use labels in top row" 
newSheet.Range("A2").Value = "Use labels in left column" 
newSheet.Range("A3").Value = "Create links to source data" 
For i = 1 To 3 
 If aOptions(i) = True Then 
 newSheet.Cells(i, 2).Value = "True" 
 Else 
 newSheet.Cells(i, 2).Value = "False" 
 End If 
Next i 
newSheet.Columns("A:B").AutoFit

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.