Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the Cell value of A1(Cell Address) using apache poi 3.6

Tags:

I have Excel Cell Address like A1,A2. So, how to access this cell programatically using poi3.6

another way is

 row=mySheet.getRow();  cell=row.getCell(); 

But i have the address in the format of A1 ... so, how do I access those cell programatically

like image 908
Saravanan Avatar asked Nov 25 '10 11:11

Saravanan


People also ask

Which method is used to retrieve string value of a particular cell?

You can use the GetCellValue method to retrieve the value of a cell in a workbook. The method requires the following three parameters: A string that contains the name of the document to examine.


Video Answer


2 Answers

CellReference cr = new CellReference("A1"); row = mySheet.getRow(cr.getRow()); cell = row.getCell(cr.getCol()); 

See Quick Guide for more samples.

like image 60
Neeme Praks Avatar answered Oct 05 '22 04:10

Neeme Praks


There's a cellReference function

E.g.

CellReference cellReference = new CellReference("B3");

(taken from the example here)

like image 34
The Archetypal Paul Avatar answered Oct 05 '22 03:10

The Archetypal Paul