我有一个我知道列号的单元格。我需要使用 Apache POI 找出对应的字母是什么。
String column_letter = newCellReference(cell).convertNumToColString(column_number);
这是我尝试过的,但它不起作用。
最佳答案
CellReference.convertNumToColString是 static
方法。所以没有new CellReference
需要的对象。它需要来自 cell
的数字列索引可以通过Cell.getColumnIndex获得.
所以
String column_letter = CellReference.convertNumToColString(cell.getColumnIndex());
关于java - 如何获取单元格的列字母?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56474812/