# Search Data

Learn how to search for a specific text, value, or formula within a specified range of cells in Spread for WPF.

## Content

Spread for WPF allows you to search for specific content, like text, values, or formulas, in a specified range of cells using the [Find](/spreadnet/api/latest/online-wpf/GrapeCity.Spreadsheet/GrapeCity.Spreadsheet.IRange.Find.html) method of the **IRange** interface. This method provides various parameters, such as FindLookIn, LookAt, SearchOrder, SearchDirection, MatchCase, etc. to enhance your search capabilities and get precise results.
Additionally, the [FindNext](/spreadnet/api/latest/online-wpf/GrapeCity.Spreadsheet/GrapeCity.Spreadsheet.IRange.FindNext.html) and [FindPrevious](/spreadnet/api/latest/online-wpf/GrapeCity.Spreadsheet/GrapeCity.Spreadsheet.IRange.FindPrevious.html) methods help you locate the next or previous cells that match the same criteria.
The GIF below shows how to search using the FindNext method.
![](https://cdn.mescius.io/document-site-files/images/0f63724f-fddf-4351-8c24-0b4338c0fda9/images/searchdata.gif)
The following example code searches for "0" in the "Order" column and uses the FindNext method to find the next matching value within the defined range of cells.
**C#**

```csharp
IRange f;
private void btn_FindNext(object sender, RoutedEventArgs e)
{
    
     if (f == null)
     {
         // Specify the cell range to search.
         f = spreadSheet1.Workbook.Worksheets[0].Cells["H1:H50"];
         // Use the Find method to search for '0' in the cell range 'H1:H50'.
         f.Find(0, null, FindLookIn.Values, LookAt.Whole, SearchOrder.Rows, SearchDirection.Next, true).Activate();
     }
     else
     {
         // Use the FindNext method to find the next matching value in the defined range of cells.
         f.FindNext(spreadSheet1.Workbook.Worksheets[0].ActiveCell).Activate();
     }
}
```

**VB**

```auto
Private f As IRange
Private Sub btn_FindNext(sender As Object, e As RoutedEventArgs)
        If f Is Nothing Then
            ' Specify the cell range to search.
            f = spreadSheet1.Workbook.Worksheets(0).Cells("H1:H50")
            ' Use the Find method to search for '0' in the cell range 'H1:H50'.
            f.Find(0, Nothing, FindLookIn.Values, LookAt.Whole, SearchOrder.Rows, SearchDirection.[Next], True).Activate()
        Else
            ' Use the FindNext method to find the next matching value in the defined range of cells.
            f.FindNext(spreadSheet1.Workbook.Worksheets(0).ActiveCell).Activate()
        End If
End Sub
```