veri alma

Hakan ERDOST

Destek Ekibi
Destek Ekibi
Katılım
12 Eylül 2004
Mesajlar
871
Excel Vers. ve Dili
Excel 2019 Türkçe (Ev)
Excel 2013 Türkçe (Okul)
Kod:
Sub VeriGetir()
    Dim depoSayfa As Worksheet
    Dim bbSayfa As Worksheet
    Dim depoAralik As Range
    Dim depoSutun As Range
    Dim depoHucresi As Range
    Dim arananVeri As Variant
    Dim bbHucresi As Range

    ' Sayfaları belirle
    Set depoSayfa = Worksheets("DEPO")
    Set bbSayfa = Worksheets("BB")

    ' Depo aralığını belirle (B1:D aralığı)
    Set depoAralik = depoSayfa.Range("B1:D" & depoSayfa.Cells(depoSayfa.Rows.Count, "B").End(xlUp).Row)

    ' BB sayfasındaki K8 hücresinden değeri al
    arananVeri = bbSayfa.Range("K8").Value

    ' Depo aralığında arama yap
    For Each depoSutun In depoAralik.Columns
        Set depoHucresi = depoSutun.Find(arananVeri, LookIn:=xlValues)
        If Not depoHucresi Is Nothing Then
            ' Bulunan hücrenin karşısındaki c15 ve m15 hücrelerini BB sayfasına yaz
            bbSayfa.Range("C15").Value = depoSayfa.Cells(depoHucresi.Row, depoHucresi.Column + 1).Value
            bbSayfa.Range("M15").Value = depoSayfa.Cells(depoHucresi.Row, depoHucresi.Column + 2).Value
            Exit For
        End If
    Next depoSutun
End Sub
Deneyiniz
 

Ekli dosyalar

agunes4242

Altın Üye
Katılım
11 Ekim 2023
Mesajlar
13
Excel Vers. ve Dili
Excel Vers. ve Dili Ofis 2013 TR 64 Bit
Altın Üyelik Bitiş Tarihi
29-10-2024
Teşekkürler ederim yardımlar için üstat
 
Üst