Gamma taglia e incolla
Contents
[
Hide
]
Taglia e incolla Cells
Aspose.Cells ti offre la possibilità di tagliare e incollare le celle all’interno di un foglio di lavoro utilizzando il fileInsertCutCells metodo delCells collezione. IlInsertCutCellsaccetta i seguenti parametri.
- Allinearel’intervallo di celle da tagliare.
- Indice riga: l’indice della riga in cui inserire le celle.
- Indice colonna: l’indice della colonna in cui inserire le celle.
- Tipo di spostamento: La direzione di spostamento delle colonne.
L’esempio seguente mostra come tagliare e incollare le celle all’interno di un foglio di lavoro.
Codice d’esempio
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"); |