Range.FindPrevious Method

Continues a search that was begun with the Find method.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function FindPrevious ( _
    After As Object _
) As Range
'Usage
Dim instance As Range
Dim After As Object
Dim returnValue As Range

returnValue = instance.FindPrevious(After)
Range FindPrevious(
    Object After
)

Parameters

  • After
    Type: System.Object

    Optional Object. The cell before which you want to search. This corresponds to the position of the active cell when a search is done from the user interface. Note that After must be a single cell in the range. Remember that the search begins before this cell; the specified cell isn’t searched until the method wraps back around to this cell. If this argument isn’t specified, the search starts before the upper-left cell in the range.

Return Value

Type: Microsoft.Office.Interop.Excel.Range

Remarks

Finds the previous cell that matches those same conditions and returns a Range object that represents that cell.

This method doesn’t affect the selection or the active cell.

When the search reaches the beginning of the specified search range, it wraps around to the end of the range. To stop a search when this wraparound occurs, save the address of the first found cell, and then test each successive found-cell address against this saved address.

See Also

Reference

Range Interface

Range Members

Microsoft.Office.Interop.Excel Namespace