XmlMappedRange.FindNext(Object) Yöntem

Tanım

public Microsoft.Office.Interop.Excel.Range FindNext (object After);
abstract member FindNext : obj -> Microsoft.Office.Interop.Excel.Range
Public Function FindNext (Optional After As Object) As Range

Parametreler

After
Object

Arama yapmak istediğiniz hücre. Bu, kullanıcı arabiriminden bir arama yapıldığında etkin hücrenin konumuna karşılık gelir. Denetimde AfterXmlMappedRange tek bir hücre olması gerektiğini unutmayın. Aramanın bu hücreden sonra başlayacağını unutmayın. Yöntem, bu hücreye geri sarana kadar belirtilen hücre aranmaz. Bu bağımsız değişken belirtilmezse, arama denetimin sol üst köşesindeki hücreden XmlMappedRange sonra başlar.

Döndürülenler

Range Belirtilen bilgileri içeren bir hücreyi temsil eden.

Örnekler

Aşağıdaki kod örneği değerini XmlMappedRange "Smith" dizesine ayarlar ve ardından , FindNextve FindPrevious yöntemlerini kullanarak Find"Smith" dizesine sahip ilk hücreyi bulur. Her zaman tam olarak bir XmlMappedRange hücre içerdiğinden, her durumda aynı hücre bulunur. Bu kod örneği, geçerli çalışma sayfasının adlı CustomerLastNameCellbir XmlMappedRange içerdiğini varsayar.

private void FindSmith()
{
    this.CustomerLastNameCell.Value2 = "Smith";

    // Use Find to get the range with "Smith".
    Excel.Range range1 = this.CustomerLastNameCell.Find("Smith",
        Excel.XlSearchDirection.xlNext);
    string address1 = range1.get_Address(missing, missing,
        Excel.XlReferenceStyle.xlA1);
    MessageBox.Show("Find method found the range: " + address1);

    // Use FindNext to get the range with "Smith".
    Excel.Range range2 = this.CustomerLastNameCell.FindNext(range1);
    string address2 = range2.get_Address(
        Excel.XlReferenceStyle.xlA1);
    MessageBox.Show("FindNext method found the range: " + address2);

    // Use FindPrevious to get the range with "Smith".
    Excel.Range range3 = this.CustomerLastNameCell.FindPrevious(range2);
    string address3 = range3.get_Address(
        Excel.XlReferenceStyle.xlA1);
    MessageBox.Show("FindPrevious method found the range: " + address3);
}
Private Sub FindSmith()
    Me.CustomerLastNameCell.Value2 = "Smith"

    ' Use Find to get the range with "Smith".
    Dim range1 As Excel.Range = Me.CustomerLastNameCell.Find( _
        "Smith", SearchDirection:=Excel.XlSearchDirection.xlNext)
    Dim address1 As String = range1.Address(ReferenceStyle:=Excel.XlReferenceStyle.xlA1)
    MsgBox("Find method found the range: " & address1)

    ' Use FindNext to get the range with "Smith".
    Dim range2 As Excel.Range = Me.CustomerLastNameCell.FindNext(range1)
    Dim address2 As String = range2.Address(ReferenceStyle:=Excel.XlReferenceStyle.xlA1)
    MsgBox("FindNext method found the range: " & address2)

    ' Use FindPrevious to get the range with "Smith".
    Dim range3 As Excel.Range = Me.CustomerLastNameCell.FindPrevious(range2)
    Dim address3 As String = range3.Address(ReferenceStyle:=Excel.XlReferenceStyle.xlA1)
    MsgBox("FindPrevious method found the range: " & address3)
End Sub

Açıklamalar

Yöntemi için belirtilen koşullarla eşleşen sonraki hücreyi bulur ve bu hücreyi Find temsil eden bir Range döndürür.

Bu yöntem, seçimi veya etkin hücreyi etkilemez.

Arama belirtilen arama aralığının sonuna ulaştığında, aralığın başına doğru kaydırılır. Bu metin çevresinde kaydırma işlemi oluştuğunda aramayı durdurmak için, ilk bulunan hücrenin adresini kaydedin ve bulunan her ardışık hücre adresini kaydedilen bu adresle sınayın.

İsteğe Bağlı Parametreler

İsteğe bağlı parametreler hakkında bilgi için bkz. Office Çözümlerinde İsteğe Bağlı Parametreler.

Şunlara uygulanır