カット アンド ペースト範囲
Contents
[
Hide
]
カットアンドペースト Cells
Aspose.Cells を使用すると、ワークシート内のセルをカット アンド ペーストできます。InsertCellsの方法Cellsコレクション。のInsertCells次のパラメータを受け入れます。
次の例は、ワークシート内のセルを切り取って貼り付ける方法を示しています。
サンプルコード
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-.NET | |
//Source directory | |
string outDir = RunExamples.Get_OutputDirectory(); | |
Workbook workbook = new Workbook(); | |
Worksheet worksheet = workbook.Worksheets[0]; | |
worksheet.Cells[0, 2].Value = 1; | |
worksheet.Cells[1, 2].Value = 2; | |
worksheet.Cells[2, 2].Value = 3; | |
worksheet.Cells[2, 3].Value = 4; | |
worksheet.Cells.CreateRange(0, 2, 3, 1).Name = "NamedRange"; | |
Range cut = worksheet.Cells.CreateRange("C:C"); | |
worksheet.Cells.InsertCutCells(cut, 0, 1, ShiftType.Right); | |
workbook.Save(outDir + "CutAndPasteCells.xlsx"); |