Unmerge Cells in Excel using Java

This article explains how to unmerge cells in Excel using Java. It contains the IDE settings, a list of steps to accomplish the task, and a sample code to split merged cells in Excel using Java. It will explain all or selected merged areas from a sheet using various methods in this API.

Steps to Unmerge Cells using Java

  1. Set the IDE to use Aspose.Cells for Java to split the merged cells
  2. Load the source Excel file into the Workbook object having one or more merged areas
  3. Access the sheet with merged areas
  4. Get the collection of all the merged cell areas in the selected sheet
  5. Iterate through all the merged cell areas and create a range for each
  6. Call the unMerge() method for each range
  7. Save the output Excel file after removing the merged areas

These steps summarize the process to split merged cells using Java. Commence the process by loading the source Excel file and iterating through all the merged areas in the selected sheet. Create a range against each merged area and call the unMerge() method to remove the merging without losing the data in the merged cells.

Code to Unmerge Cells Without Losing Data using Java

This sample code demonstrates how to unmerge cells in Excel using Java. It shows how to eliminate all the merged areas from the selected sheet. You may remove the selected merged areas only by creating an individual range of cells for the respective cell area.

This article has guided us to remove the merged areas. If you want to merge the cells, refer to the article on How to merge cells in Excel using Java.

 English