Limiting cells to only numeric values in Apache POI
问题 We are using Apache POI library to create the excel sheets. How can we restrict the cells to accept only numeric values ? Is there any class that restricts to only numbers in Apache POI library ? Thanks Rama Krishna 回答1: Perhaps, I should have asked my question like how to add Data Validation in Excel using Apache POI. But here is the code to do so. I guess this can help someone. It worked for me. You need to be careful with Cell Range. XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet =