# Searching for Data with Code

Learn how to search for data within cells of a sheet using FpSpread class methods. Find out how to specify the sheet, search string, and matching criteria for effective data retrieval.

## Content

To search for data in any of the cells of a sheet, use any of these sets of methods in the [FpSpread](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.html) class:

* [Search](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.Search.html) methods
* [SearchHeaders](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SearchHeaders.html) methods
* [SearchWithDialog](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SearchWithDialog.html) methods
* [SearchWithDialogAdvanced](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SearchWithDialogAdvanced.html) methods

The parameters of the various search methods allow you to specify the sheet to search, the string for which to search, and the matching criteria. For a list of qualifications (restrictions) of the search, refer to the set of methods listed above for more details.
Most searches (except for the method that specifies a block range of cells) start at the specified start cell and continue to the end of the row and then start the next row at the first cell. The search continues until either the end cell or the end of the sheet.
For information about the search dialogs, refer to [Allowing the User to Perform a Standard Search](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-interact-rowcol/spwin-datasearch/spwin-searchdialog) and [Allowing the User to Perform an Advanced Search](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-interact-rowcol/spwin-datasearch/spwin-searchadvanced).

## Using Code

Use the [Search](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.Search.html) method for the Spread component to perform a search.

## Example

This example uses the [Search](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.Search.html) method for the Spread component to perform an exact-match search on the third sheet (Sheet 2) for the word "Total" and return the values of the row index and column index of the found cell.

```csharp
fpSpread1.Search(2,"Total",true,true,false,false,1,1,56,56, ref rowindx,ref colindx);
```

```vbnet
FpSpread1.Search(2,"Total",True,True,False,False,1,1,56,56,rowindx,colindx)
```

## See Also

[Allowing the User to Perform a Standard Search](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-interact-rowcol/spwin-datasearch/spwin-searchdialog)
[Allowing the User to Perform an Advanced Search](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-interact-rowcol/spwin-datasearch/spwin-searchadvanced)