主题
ConsolidationSources (属性)
返回一个字符串数组,这些字符串是工作表中当前合并计算的数据源的名称。如果工作表中没有合并计算,将返回 None。Any 类型,只读。
示例
python
#本示例显示在工作表 Sheet1 中用于合并计算的数据源的名称。该列表将出现在本示例新建的工作表中
def test():
newSheet = Worksheets.Add()
newSheet.Range("A1").Value2 = "Consolidation Sources"
aSources = Worksheets.Item("Sheet1").ConsolidationSources
if aSources == None:
newSheet.Range("A2").Value2 = "none"
else:
for i in range(1, len(aSources)):
newSheet.Cells(i + 1, 1).Value2 = aSources[i]
newSheet.Columns("A:B").AutoFit()
python
#本示例判断活动工作表如果存在合并计算的数据源的名称,则输出ConsolidationSources属性的数据类型
def test():
if ActiveSheet.ConsolidationSources != None:
print("ConsolidationSources属性数据类型为:" + type(ActiveSheet.ConsolidationSources))