// Create a new workbook Workbook workbook = new Workbook(); IWorksheet worksheet = workbook.getWorksheets().get(0); Object[][] data = new Object[][]{ {"Name", "City", "Birthday", "Eye color", "Weight", "Height"}, {"Richard", "New York", new GregorianCalendar(1968, 6, 8), "Blue", 67, 165}, {"Nia", "New York", new GregorianCalendar(1972, 7, 3), "Brown", 62, 134}, {"Jared", "New York", new GregorianCalendar(1964, 3, 2), "Hazel", 72, 180}, {"Natalie", "Washington", new GregorianCalendar(1972, 8, 8), "Blue", 66, 163}, {"Damon", "Washington", new GregorianCalendar(1986, 2, 2), "Hazel", 76, 176}, {"Angela", "Washington", new GregorianCalendar(1993, 2, 15), "Brown", 68, 145} }; worksheet.getRange("A1:F7").setValue(data); worksheet.getRange("A:F").setColumnWidth(15); //Weight less than 80. worksheet.getRange("A1:F7").autoFilter(4, "<72"); //Copy range and ignore hidden range. IWorksheet worksheet2 = workbook.getWorksheets().add(); PasteOption pasteOption = new PasteOption(); pasteOption.setAllowPasteHiddenRange(false); worksheet.getRange("A1:F7").copy(worksheet2.getRange("A1:F7"), pasteOption); //Copy range and contain hidden range. IWorksheet worksheet3 = workbook.getWorksheets().add(); worksheet.getRange("A1:F7").copy(worksheet3.getRange("A1:F7")); // Save to an excel file workbook.save("CopyAndIgnoreHiddenRange.xlsx");