——— title: How to use Search description: Open the Search dialog to find values, formulas, or comments, then navigate or replace matches. keywords: Search, Find what, Replace, Replace All, Look in, Match entire contents, Case Sensitive, Values, Formulas, Comments type: docs weight: 1 url: /java/aspose-cells-gridjs/user-guide/how-to-search/ aliases:
- /java/aspose-cells-gridjs/how-to-find
- /java/aspose-cells-gridjs/how-to-replace
- /java/aspose-cells-gridjs/how-to-replace-all
- /java/aspose-cells-gridjs/how-to-search-comments
- /java/aspose-cells-gridjs/how-to-search-formulas
———
Introduction
Search opens a dialog that lets you find text across Values, Formulas, or Comments, with options like Case Sensitive and Match entire contents. You can move through matches with Next and Previous, and the current match is highlighted in the grid. A separate Find & Replace view lets you replace a single match or all matches.
How to use
-
Open Search from the toolbar or the Edit menu, or press Ctrl + F.

-
In Find what, enter your text, then choose Look in (Values, Formulas, or Comments).
-
Optionally toggle Case Sensitive and Match entire contents, then click Next or Previous to navigate matches.
-
To replace, press Ctrl + H to open Find & Replace, enter Replace with, then use Replace or Replace All.

JavaScript API
xs = x_spreadsheet('#gridjs-demo-uid', option);
// Open Search (Find) dialog. xs.sheet.modalSearch.show();
// Open Find & Replace dialog. xs.sheet.modalSearch.show(true);
Relevant functions
| Function | Description | Parameters | Returns |
|---|---|---|---|
| sheet.modalSearch.show(showReplace) | Show the Search dialog; when showReplace is true, the Replace fields are shown | ||
| and Look in is hidden. | showReplace (boolean) | void | |
| sheet.modalSearch.hide() | Close the Search dialog. | None | void |
sheet.modalSearch.show(showReplace) displays the Search UI and optionally the Replace UI based on the boolean parameter. sheet.modalSearch.hide() closes the dialog and clears the current search highlight.
Common Questions
Q: What can I search in? A: The Search dialog supports Values, Formulas, and Comments via the Look in dropdown.
Q: How do I open Replace? A: Use Ctrl + H (or call sheet.modalSearch.show(true)); the Replace fields appear and Look in is hidden.
Q: What happens if no matches are found? A: The UI shows an info message indicating that nothing was found.