Aracılığıyla paylaş


XmlMappedRange.FindNext Yöntem

İle başlamıştı bir arama devam eder Find yöntemi.

Ad alanı:  Microsoft.Office.Tools.Excel
Derleme:  Microsoft.Office.Tools.Excel (Microsoft.Office.Tools.Excel.dll içinde)

Sözdizimi

'Bildirim
Function FindNext ( _
    After As Object _
) As Range
Range FindNext(
    Object After
)

Parametreler

  • After
    Tür: System.Object
    Daha sonra aramak istediğiniz hücre.Kullanıcı arabiriminden bir arama yapıldığında bu etkin hücrenin konumuna karşılık gelir.Dikkat After tek bir hücreye olmalıdır XmlMappedRange Denetim.Arama bu hücre sonra başlayacağını unutmayın; Belirtilen hücre yöntemi bu hücreye geri etrafında kaydırılana dek aranmaz.Bu bağımsız değişken belirtilmezse, sol üst köşesindeki hücreyi sonra aramayı başlatır XmlMappedRange Denetim.

Dönüş Değeri

Tür: Microsoft.Office.Interop.Excel.Range
A Range temsil eden bir hücreyi içeren belirtilen bilgiler.

Açıklamalar

Belirtilen koşullara uyan bir sonraki hücreyi bulur Find yöntemi ve döndürür bir Range temsil eden bu hücre.

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

Aramayı belirli bir arama aralığın sonuna ulaştığında, onu çevresindeki aralığın başlangıcını sarar. Bu wraparound ortaya çıktığında bir aramayı durdurmak için ilk bulunan hücrenin adresini kaydedin ve birbirini izleyen her bulunan hücre adresi kaydedilen bu adresi karşı test etmek.

İsteğe bağlı parametreler

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

Örnekler

Aşağıdaki kod örneği ayarlar bir XmlMappedRange "Etikan" dizesini ve kullanımları Find, FindNext, ve FindPrevious "Etikan" dizesini içeren ilk hücreyi bulmak için yöntemleri. Çünkü bir XmlMappedRange her zaman tek bir içeren hücre, aynı hücreyi bulunduğunda her servis talebi. Bu kod örneği, geçerli çalışma sayfasının içerdiğini varsayar bir XmlMappedRange adlı CustomerLastNameCell.

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
private void FindSmith()
{
    this.CustomerLastNameCell.Value2 = "Smith";

    // Use Find to get the range with "Smith".
    Excel.Range range1 = this.CustomerLastNameCell.Find("Smith",
        missing, missing, missing, missing, Excel.XlSearchDirection.xlNext,
        missing, missing, missing);
    string address1 = range1.get_Address(missing, missing,
        Excel.XlReferenceStyle.xlA1, missing, missing);
    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(missing, missing, 
        Excel.XlReferenceStyle.xlA1, missing, missing);
    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(missing, missing,
        Excel.XlReferenceStyle.xlA1, missing, missing);
    MessageBox.Show("FindPrevious method found the range: " + address3);
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

XmlMappedRange Arabirim

Microsoft.Office.Tools.Excel Ad Alanı