seddur
Altın Üye
- Katılım
- 12 Nisan 2012
- Mesajlar
- 531
- Excel Vers. ve Dili
- Microsoft office professional plus 2019
Aşağıdaki kod ile N9 hücresine ürün cinsi girildiğinde N10 hücresinde fiyatı buluyor.Yapılmak istenen aranan değerin hücreye değilde Textbox'a girilerek bulunmasıdır.Tabi sonucuda textboxda gösterecek.İlgilenecek arkadaşa teşekkür ederim.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo hata
Dim KeyCells As Range
Set KeyCells = Range("N9")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
If KeyCells.Value <> "" Then
Dim urunBul As Range
Set urunBul = Worksheets("Fiyatlar").UsedRange.Find(KeyCells.Value, Lookat:=xlWhole)
Range("N10") = urunBul.Offset(0, 1).Value
End If
End If
Exit Sub
hata:
Range("N10").Value = "Ürün bulunamadı."
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo hata
Dim KeyCells As Range
Set KeyCells = Range("N9")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
If KeyCells.Value <> "" Then
Dim urunBul As Range
Set urunBul = Worksheets("Fiyatlar").UsedRange.Find(KeyCells.Value, Lookat:=xlWhole)
Range("N10") = urunBul.Offset(0, 1).Value
End If
End If
Exit Sub
hata:
Range("N10").Value = "Ürün bulunamadı."