Thanks for the details and screenshot.
Well, you may easily do that using data filters and data sorting features provided by Aspose.Cells APIs. I have created a code segment to accomplish a part of of your task using a template file (attached). The template file has the data as per your screenshot. I apply custom data filtering to the third column on your specified range of cells. After filtering data, I created the source range. Then I created a destination range in the other sheet and instantiated Paste Options so only visible cells should be copied from source range to destination range. I finally copied the source range to destination range with respect to Paste Options and saved the file. Please refer to it and write your own code for data filtering and data sorting for your needs:
// Opening the Excel file through the file path
Workbook workbook = new Workbook("f:\\files\\Bk_filtersort1.xlsx");
// Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.getWorksheets().get(0);
// Creating AutoFilter by giving the cells range
// Initialize filter for rows containing string "FALSE"
worksheet.getAutoFilter().custom(2, FilterOperatorType.EQUAL, "FALSE");
// Call Filter function to apply the filter
// Call refresh function to update the worksheet
//Create the source range to be copied
Range sourcerange = worksheet.getCells().createRange("A5:D19");
// Accessing the second worksheet in the Excel file
Worksheet worksheet1 = workbook.getWorksheets().get(1);
//Create a destination range.
Range destrange = worksheet1.getCells().createRange("A1:D14");
//Create the PasteOptions accordingly
PasteOptions options = new PasteOptions();
//Copy the range
// Saving the modified Excel file
We also recommend you to see the document on how to do data sorting for your reference:
Moreover, see the document on how to apply custom data filtering for your further reference:
Hope, this helps a bit.
files1.zip (6.6 KB)