//For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C

//Path of input excel file
StringPtr sampleCopyingRowsAndColumns = dirPath->StringAppend(new String("sampleCopyingRowsAndColumns.xlsx"));

//Path of output excel file
StringPtr outputCopyingRowsAndColumns = outPath->StringAppend(new String("outputCopyingRowsAndColumns.xlsx"));

//Read input excel file
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook(sampleCopyingRowsAndColumns);

//Accessing the first worksheet in the Excel file
intrusive_ptr<IWorksheet> worksheet = workbook->GetIWorksheets()->GetObjectByIndex(0);

//Copy the third column to eighth column
worksheet->GetICells()->CopyColumn(worksheet->GetICells(), 2, 7);

//Save the Excel file.
workbook->Save(outputCopyingRowsAndColumns);