title: how to shift column in java xssf poi
body: <p>How to copy an existing column data and formatting into next column in Apache POI and shift the next column to right.</p>
  
  <p>I tried this.
  Let say my code is this...</p>
  
  <pre><code>XSSFCell oldCell = worksheet.getRow(0).getCell(1);
  XSSFCell newCell =  worksheet.getRow(0).getCell(2);
  
  if(styleMap != null) {   
          if(oldCell.getSheet().getWorkbook() == newCell.getSheet().getWorkbook()){   
              newCell.setCellStyle(oldCell.getCellStyle());   
          } else{   
              int stHashCode = oldCell.getCellStyle().hashCode();   
              XSSFCellStyle newCellStyle = styleMap.get(stHashCode);   
              if(newCellStyle == null){   
                  newCellStyle = newCell.getSheet().getWorkbook().createCellStyle();   
                  newCellStyle.cloneStyleFrom(oldCell.getCellStyle());   
                  styleMap.put(stHashCode, newCellStyle);   
              }   
              newCell.setCellStyle(newCellStyle);   
          }   
  
      }
  </code></pre>
  
  <p>I able to copy value from old cell to new cell but it doesn't shift the existing column to right.</p>
  
  <p>Thanks in advance for your help.</p>