نقل مدى Cells في ورقة عمل

نقل مدى Cells في ورقة عمل

يستخدم رمز المثال ملف قالب لتوضيح المهمة.

ملف الإدخال

ما يجب القيام به: image_بديل_نص

الرجاء مراجعة الملف التالي الذي تم إنشاؤه بنطاق A1: B5 تم نقله إلى C1: D5.

ملف الإخراج

ما يجب القيام به: image_بديل_نص

// 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(MoveRangeOfCellsInWorksheet.class);
// Instantiate the workbook object. Open the Excel file
Workbook workbook = new Workbook(dataDir + "book1.xls");
Cells cells = workbook.getWorksheets().get(0).getCells();
// Create Cell's area
CellArea ca = CellArea.createCellArea("A1", "B5");
// Move Range
cells.moveRange(ca, 0, 2);
// Save the resultant file
workbook.save(dataDir + "book2.xls");