非連続範囲の実装
Contents
[
Hide
]
可能な使用シナリオ
通常、名前付き範囲は、連続して隣接するセルの長方形です。しかし、隣接していないセルが含まれる非連続セル範囲を使用する必要がある場合があります。 Aspose.Cells for Python via .NET では、非連続セルを持つ名前付き範囲の作成をサポートしています。
Aspose.Cells for Python Excel ライブラリを使用して非連続範囲を追加する方法
以下のコードサンプルは、Aspose.Cells for Python via .NET を使用して名前付きの非連続範囲を作成する方法を示しています。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aspose.cells import Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Instantiating a Workbook object | |
workbook = Workbook() | |
# Adding a Name for non sequenced range | |
index = workbook.worksheets.names.add("NonSequencedRange") | |
name = workbook.worksheets.names[index] | |
# Creating a non sequence range of cells | |
name.refers_to = "=Sheet1!$A$1:$B$3,Sheet1!$E$5:$D$6" | |
# Save the workbook | |
workbook.save(dataDir + "Output.out.xlsx") |