Find cells with specific style
Using Microsoft Excel
These are the steps required to search cells with specific styles in MS Excel.
- Select Find & Select in the Home Tab.
- Select Find.
- Click Options if advanced options are not visible.
- Select Choose Format From Cell… from the Format dropdown.
- Select the cell with the style that you want to search.
- 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.
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”.
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”
Figure: Output file with found cells after searching by A1 style