Verilen Satırdan İtibaren Alta Doğru Arama Yap - Microsoft Excel


Verilen satırdan aşağı doğru arama yapan ve bulunan ilk hücrenin adresini mesaj olarak veren VBA kodudur.

Kod


Option Explicit

Sub VerilenSatirdanItibarenAltaDogruAramaYap()
    Dim aranan    As String
    Dim bulunduMu As Boolean
    
    Range("B2").Select
    bulunduMu = False
    aranan = "ARANAN_DEGER_BURAYA_GELECEK"
    
    Do Until IsEmpty(ActiveCell)
        If ActiveCell.Value = aranan Then
            bulunduMu = True
            Exit Do
        End If
        
        ActiveCell.Offset(1, 0).Select
    Loop
    
    If bulunduMu = True Then
        MsgBox "Değerin bulunduğu hücre: " & ActiveCell.Address
    Else
        MsgBox "Değer bulunamadı."
    End If
End Sub

Etiketler
microsoft excel microsoft excel vba microsoft excel vba arama işlemleri