Find cells with specific style

Using Microsoft Excel

These are the steps required to search cells with specific styles in MS Excel.

  1. Select Find & Select in the Home Tab.
  2. Select Find.
  3. Click Options if advanced options are not visible.
  4. Select Choose Format From Cell… from the Format dropdown.
  5. Select the cell with the style that you want to search.
  6. Click Find All to find all the cells with style similar to your selected cell.

Using Aspose.Cells for Java

Aspose.Cells for Java provides the feature to find cells in worksheet with some specific style. For this, the API provides FindOptions.setStyle() property.

Sample Code

The following code snippet finds all the cells which have the same style as that of cell A1 and changes the text inside those cells. Please see the screenshot of the source and output files to analyze the output of the sample code.

After the execution of code, all the cells that have the same style as of cell A1 will have a text “Found”.

Screenshots

todo:image_alt_text

Figure: Source file with cells having styles

Here is the output file generated by the following code. You can see all the cells that have the same style as of cell A1 has a text “Found”

todo:image_alt_text

Figure: Output file with found cells after searching by A1 style