非順次範囲の実装
Contents
[
Hide
]
通常は、名前付き範囲セルが連続し、互いに隣接している長方形です。ただし、セルが隣接していない連続していないセル範囲を使用する必要がある場合もあります。 Aspose.Cells は、隣接していないセルを含む名前付き範囲の作成をサポートしています。このために、API はName.RefersTo財産。
Java 非順次範囲を実装するコード
次のコード サンプルは、Aspose.Cells for Java を使用して、名前付きの非連続範囲を作成する方法を示しています。
This file contains hidden or 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
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(ImplementingNonSequentialRanges.class); | |
// Instantiating a Workbook object | |
Workbook workbook = new Workbook(); | |
// Adding a Name for non sequenced range | |
int index = workbook.getWorksheets().getNames().add("NonSequencedRange"); | |
Name name = workbook.getWorksheets().getNames().get(index); | |
// Creating a non sequence range of cells | |
name.setRefersTo("=Sheet1!$A$1:$B$3,Sheet1!$D$5:$E$6"); | |
// Save the workbook | |
workbook.save(dataDir + "dest.xls"); |