title: Java Check if the Text in a Cell is Bolded Using Apache POI HSSF
body: <p>Using Java and Hssf to get Excel data, how to check if a cell is bolded?
  I am iterating through all sheets, all rows, and all cells of an Excel workbook. I want to perform an action if the cell is bolded.</p>
  
  <pre><code>//Iterate through excel sheets    
  for (int i = 0; i &lt; workbook.getNumberOfSheets(); i++) {
      HSSFSheet excelSheet = workbook.getSheetAt(i);
      HSSFRow row;
      Iterator rows = excelSheet.rowIterator();
  
      //Iterate through rows        
      while (rows.hasNext()) {
          row = (HSSFRow) rows.next();
          HSSFCell cell;
          Iterator cells = row.cellIterator();
  
          //Iterate through cells            
          while (cells.hasNext()) {
              cell = (HSSFCell) cells.next();
  
              //If cell contains all bolded text
              //DO Something
          }
      }
  }
  </code></pre>