- Katılım
- 11 Ekim 2023
- Mesajlar
- 15
- Excel Vers. ve Dili
- Excel Vers. ve Dili Ofis 2013 TR 64 Bit
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
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