Hi,
See the sample code to accomplish your task for your reference:
e.g
Sample code:
String filePath = “Book1.xlsx”;
Workbook workbook = new Workbook(filePath);
String strToFind = “Test”;
FindOptions options = new FindOptions();
options.setLookAtType(LookAtType.CONTAINS);
options.setCaseSensitive(false);
int counter = 0;
for (int i = 0; i < workbook.getWorksheets().getCount(); i++)
{
Worksheet worksheet = workbook.getWorksheets().get(i);
Cell found = null;
do
{
found = worksheet.getCells().find(strToFind, found, options);
if (found == null)
break;
counter++;
} while (true);
}
System.out.println("Number of Occurrences: " + counter);
Hope, this helps a bit.
Thank you.