How to get the value of a cell at a specified position in an excel sheet using JAVA How to get the value of a cell at a specified position in an excel sheet using JAVA apache apache

How to get the value of a cell at a specified position in an excel sheet using JAVA


You probably want to use the CellReference utility class to help you out.

You can then do something like:

 Sheet sheet = workbook.getSheet("MyInterestingSheet"); CellReference ref = new CellReference("B12"); Row r = sheet.getRow(ref.getRow()); if (r != null) {    Cell c = r.getCell(ref.getCol()); }

That will let you find the cell at a given Excel-style reference


if that sheet has name,u can get the sheet name and use iterator.

  Iterator iterator = workSheet.rowIterator();  while(iterator.next){       Row row = (Row) iterator.next();        //u can iterate and use row.getCell(i)  }