• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

düşey ya da yatay arama hakkında

Katılım
6 Temmuz 2008
Mesajlar
1,875
Excel Vers. ve Dili
OFFİCE 2010- TÜRKÇE
arkadaşlar o kadar taradım ama bulamadım bir formüle ya da koda ihtiyacım var

sayfa1 deki d1 hücresindeki veriyi sayfa 2de e sütununda arayıp karşılık gelen f sütunundaki değeri getirecek bir formül ya da kod arıyorum..
insaşşal anlatabilmişimdir..
 
Option Explicit

Private Sub Label3_Click()

End Sub

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)

Dim c As Range, sat As Long, Adr As String
Dim S1 As Worksheet, S2 As Worksheet, Su As Worksheet
Dim Adet, Barkod, Emtia

Set S1 = Sheets("SAYIM1")
Set S2 = Sheets("SAYIM2")
Set Su = Sheets("ÜRÜN LİSTESİ")

Application.ScreenUpdating = False

With TextBox1
If .Text = "" Then Exit Sub
If .Text <> WorksheetFunction.Substitute(.Text, "*", "") Then
Adet = Val(Split(.Text, "*")(0))
Barkod = Split(.Text, "*")(1)
Else
Adet = 1
Barkod = .Text
End If
End With

sat = Cells(Rows.Count, "c").End(xlUp).Row + 1
Set c = Su.Range("c:c").Find(Barkod, , xlValues, xlWhole)
If Not c Is Nothing Then
Label4.Caption = Su.Cells(c.Row, "d")
Emtia = Su.Cells(c.Row, "e")


Else
Emtia = "YENİ TANIMLANAN ÜRÜN"
UserForm2.Show
End If

Set c = S1.Range("c:c").Find(Barkod, , xlValues, xlWhole)
If Not c Is Nothing Then
S1.Select
ElseIf S1.Range("c" & Rows.Count) <> "" Then
S2.Select
End If

Set c = Range("A:A").Find(Barkod, , xlValues, xlWhole)
If Not c Is Nothing Then
Cells(c.Row, "B") = Val(Cells(c.Row, "B")) + Adet
Else
Cells(sat, "A") = Barkod
Cells(sat, "B") = Adet
Cells(sat, "C") = Label4.Caption
Cells(sat, "D") = Emtia
Cells(sat, "F") = sat - 1

End If


TextBox1.Text = "": Label4.Caption = ""
TextBox1.SetFocus
Application.ScreenUpdating = True


End Sub

Private Sub TextBox2_Enter()
TextBox1.SetFocus
End Sub

Private Sub UserForm_Click()

End Sub


bu şekilde bir kod var elimde kullanmış olduğum dosyada bu formulu kod olarak uyarlayabilirmyiz..
 
Geri
Üst