非連続範囲の実装
Contents
[
Hide
]
通常、名前付き範囲は連続して隣接するセルで長方形を形成します。しかし、連続していないセルを含む非連続セル範囲を使用することがあります。Aspose.Cells は非連続セルで名前付き範囲を作成することをサポートしています。
以下のコードサンプルは、Aspose.Cells for .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
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Instantiating a Workbook object | |
Workbook workbook = new Workbook(); | |
// Adding a Name for non sequenced range | |
int index = workbook.Worksheets.Names.Add("NonSequencedRange"); | |
Name name = workbook.Worksheets.Names[index]; | |
// Creating a non sequence range of cells | |
name.RefersTo = "=Sheet1!$A$1:$B$3,Sheet1!$D$5:$E$6"; | |
// Save the workbook | |
workbook.Save(dataDir+ "Output.out.xlsx"); |