Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 1.21 KB

Excel.Worksheet.ConsolidationSources.md

File metadata and controls

47 lines (32 loc) · 1.21 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Worksheet.ConsolidationSources property (Excel)
vbaxl10.chm175089
vbaxl10.chm175089
Excel.Worksheet.ConsolidationSources
d7868b1c-c9ae-97c5-a092-033fe52db5d4
05/30/2019
medium

Worksheet.ConsolidationSources property (Excel)

Returns an array of string values that name the source sheets for the worksheet's current consolidation. Returns Empty if there's no consolidation on the sheet. Read-only Variant.

Syntax

expression.ConsolidationSources

expression A variable that represents a Worksheet object.

Example

This example displays the names of the source ranges for the consolidation on Sheet1. The list appears on a new worksheet created by the example.

Set newSheet = Worksheets.Add 
newSheet.Range("A1").Value = "Consolidation Sources" 
aSources = Worksheets("Sheet1").ConsolidationSources 
If IsEmpty(aSources) Then 
 newSheet.Range("A2").Value = "none" 
Else 
 For i = 1 To UBound(aSources) 
 newSheet.Cells(i + 1, 1).Value = aSources(i) 
 Next i 
End If 
newSheet.Columns("A:B").AutoFit

[!includeSupport and feedback]