Soru listboxda secilen veriyi,ilgili sayfada iki kriteri dogrulayarak textbox a getirme

Katılım
20 Haziran 2011
Mesajlar
29
Excel Vers. ve Dili
Microsoft 365 Deutsch
arkadaslar merhaba, asagidaki kodlar ile, listbox1 icinde listelenen isimler var, hangi isme tiklarsam o ismi tabelle1 deki B sütünunda buluyor, ve textbox lara getiriyor ama lsitede ayni isme sahip 4 kisi olabiliyor o yüzden ilk bulunani texbox a getiriyor, buna ilave olarak sunu yapmak istiyorum, aramayi ad soyad olarak yapsin.
umarim sorunumu ifade edebilmisimdir. kisacasi listboxta hangi isme cift tiklarsam onu tabelle1 de isim ve soyisme göre arasin

Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)

On Error GoTo Bitir
vbDatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 0), "dd.mm.yyyy")
vbNachname.Value = ListBox1.List(ListBox1.ListIndex, 1)
vbVorname.Value = ListBox1.List(ListBox1.ListIndex, 2)
vbPassnummer.Value = ListBox1.List(ListBox1.ListIndex, 3)
vbGbdatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 4), "dd.mm.yyyy")
vbFreigabe.Value = ListBox1.List(ListBox1.ListIndex, 5)
vbZahlungsmethode.Value = ListBox1.List(ListBox1.ListIndex, 6)
vbZahlungsdatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 7), "dd.mm.yyyy")


Tabelle1.Range("B:B").Select
Selection.find(What:=vbNachname.Value, LookAt:=xlWhole).Select
Exit Sub
Bitir: MsgBox "Der gesuchte Datensatz konnte nicht gefunden werden"
End Sub
 

volki_112

Altın Üye
Katılım
29 Eylül 2023
Mesajlar
613
Excel Vers. ve Dili
2019 Türkçe
Altın Üyelik Bitiş Tarihi
13-12-2029
arkadaslar merhaba, asagidaki kodlar ile, listbox1 icinde listelenen isimler var, hangi isme tiklarsam o ismi tabelle1 deki B sütünunda buluyor, ve textbox lara getiriyor ama lsitede ayni isme sahip 4 kisi olabiliyor o yüzden ilk bulunani texbox a getiriyor, buna ilave olarak sunu yapmak istiyorum, aramayi ad soyad olarak yapsin.
umarim sorunumu ifade edebilmisimdir. kisacasi listboxta hangi isme cift tiklarsam onu tabelle1 de isim ve soyisme göre arasin

Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)

On Error GoTo Bitir
vbDatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 0), "dd.mm.yyyy")
vbNachname.Value = ListBox1.List(ListBox1.ListIndex, 1)
vbVorname.Value = ListBox1.List(ListBox1.ListIndex, 2)
vbPassnummer.Value = ListBox1.List(ListBox1.ListIndex, 3)
vbGbdatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 4), "dd.mm.yyyy")
vbFreigabe.Value = ListBox1.List(ListBox1.ListIndex, 5)
vbZahlungsmethode.Value = ListBox1.List(ListBox1.ListIndex, 6)
vbZahlungsdatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 7), "dd.mm.yyyy")


Tabelle1.Range("B:B").Select
Selection.find(What:=vbNachname.Value, LookAt:=xlWhole).Select
Exit Sub
Bitir: MsgBox "Der gesuchte Datensatz konnte nicht gefunden werden"
End Sub
Diger bakilacak sutun hangisi. B sutununda adi ariyor. Soyad hangi sutunda yazili
 

volki_112

Altın Üye
Katılım
29 Eylül 2023
Mesajlar
613
Excel Vers. ve Dili
2019 Türkçe
Altın Üyelik Bitiş Tarihi
13-12-2029
C sütünunda soyad
deneyiniz. Çözüm olmazsa dosyanızı paylaşınız. dosya. co dosya.tc gibi sitelere dosyanızı yükleyip link verebilirsiniz.
Kod:
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)

    On Error GoTo Bitir

    vbDatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 0), "dd.mm.yyyy")
    vbNachname.Value = ListBox1.List(ListBox1.ListIndex, 1)
    vbVorname.Value = ListBox1.List(ListBox1.ListIndex, 2)
    vbPassnummer.Value = ListBox1.List(ListBox1.ListIndex, 3)
    vbGbdatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 4), "dd.mm.yyyy")
    vbFreigabe.Value = ListBox1.List(ListBox1.ListIndex, 5)
    vbZahlungsmethode.Value = ListBox1.List(ListBox1.ListIndex, 6)
    vbZahlungsdatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 7), "dd.mm.yyyy")

    Dim ws As Worksheet
    Set ws = ThisWorkbook.Sheets("Tabelle1")

    Dim lastRow As Long
    lastRow = ws.Cells(ws.Rows.Count, "B").End(xlUp).Row

    Dim i As Long
    For i = 2 To lastRow ' Başlık varsa 2'den başlıyoruz
        If ws.Cells(i, "B").Value = vbNachname.Value And ws.Cells(i, "C").Value = vbVorname.Value Then
            ws.Cells(i, "B").Select ' İsterseniz burada sadece veri işlemi de yapabilirsiniz
            Exit Sub
        End If
    Next i

Bitir:
    MsgBox "Der gesuchte Datensatz konnte nicht gefunden werden"

End Sub
 
Katılım
20 Haziran 2011
Mesajlar
29
Excel Vers. ve Dili
Microsoft 365 Deutsch
deneyiniz. Çözüm olmazsa dosyanızı paylaşınız. dosya. co dosya.tc gibi sitelere dosyanızı yükleyip link verebilirsiniz.
Kod:
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)

    On Error GoTo Bitir

    vbDatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 0), "dd.mm.yyyy")
    vbNachname.Value = ListBox1.List(ListBox1.ListIndex, 1)
    vbVorname.Value = ListBox1.List(ListBox1.ListIndex, 2)
    vbPassnummer.Value = ListBox1.List(ListBox1.ListIndex, 3)
    vbGbdatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 4), "dd.mm.yyyy")
    vbFreigabe.Value = ListBox1.List(ListBox1.ListIndex, 5)
    vbZahlungsmethode.Value = ListBox1.List(ListBox1.ListIndex, 6)
    vbZahlungsdatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 7), "dd.mm.yyyy")

    Dim ws As Worksheet
    Set ws = ThisWorkbook.Sheets("Tabelle1")

    Dim lastRow As Long
    lastRow = ws.Cells(ws.Rows.Count, "B").End(xlUp).Row

    Dim i As Long
    For i = 2 To lastRow ' Başlık varsa 2'den başlıyoruz
        If ws.Cells(i, "B").Value = vbNachname.Value And ws.Cells(i, "C").Value = vbVorname.Value Then
            ws.Cells(i, "B").Select ' İsterseniz burada sadece veri işlemi de yapabilirsiniz
            Exit Sub
        End If
    Next i

Bitir:
    MsgBox "Der gesuchte Datensatz konnte nicht gefunden werden"

End Sub
cevabiniz ve ilginiz icin tesekkür ederim ,asagidaki kodlar ile maalesef tabelle1 de ad ve soyada göre arama yapmiyor, ,lsitbox da ad i secince tabelle 1 e gidip ad ve soyadin oldugu tam satiri bulmasini istiyorum, degsiklik yapmak icin kodlarim var calisiyor, tek istedigim listboxtda listelenmis herhangi bir ismi cift tikladiginda onu tabelle1 de ad ve soyadi dogrulayarak bulmasi ve textbox a getirmesi.

Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Tabelle1")

Dim lastRow As Long
lastRow = ws.Cells(ws.Rows.Count, "B").End(xlUp).Row

Dim i As Long
For i = 2 To lastRow ' Başlık varsa 2'den başlıyoruz
If ws.Cells(i, "B").Value = vbNachname.Value And ws.Cells(i, "C").Value = vbVorname.Value Then
ws.Cells(i, "B").Select ' İsterseniz burada sadece veri işlemi de yapabilirsiniz
Exit Sub
End If
Next i

Bitir:
MsgBox "Der gesuchte Datensatz konnte nicht gefunden werden"

End Sub
 

volki_112

Altın Üye
Katılım
29 Eylül 2023
Mesajlar
613
Excel Vers. ve Dili
2019 Türkçe
Altın Üyelik Bitiş Tarihi
13-12-2029
cevabiniz ve ilginiz icin tesekkür ederim ,asagidaki kodlar ile maalesef tabelle1 de ad ve soyada göre arama yapmiyor, ,lsitbox da ad i secince tabelle 1 e gidip ad ve soyadin oldugu tam satiri bulmasini istiyorum, degsiklik yapmak icin kodlarim var calisiyor, tek istedigim listboxtda listelenmis herhangi bir ismi cift tikladiginda onu tabelle1 de ad ve soyadi dogrulayarak bulmasi ve textbox a getirmesi.

Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Tabelle1")

Dim lastRow As Long
lastRow = ws.Cells(ws.Rows.Count, "B").End(xlUp).Row

Dim i As Long
For i = 2 To lastRow ' Başlık varsa 2'den başlıyoruz
If ws.Cells(i, "B").Value = vbNachname.Value And ws.Cells(i, "C").Value = vbVorname.Value Then
ws.Cells(i, "B").Select ' İsterseniz burada sadece veri işlemi de yapabilirsiniz
Exit Sub
End If
Next i

Bitir:
MsgBox "Der gesuchte Datensatz konnte nicht gefunden werden"

End Sub
dosya.tc veya dosya.co gibi paylaşım sitelerine dosyanızı yükleyip link veriniz buraya
 
Katılım
11 Temmuz 2024
Mesajlar
331
Excel Vers. ve Dili
Excel 2021 Türkçe
cevabiniz ve ilginiz icin tesekkür ederim ,asagidaki kodlar ile maalesef tabelle1 de ad ve soyada göre arama yapmiyor, ,lsitbox da ad i secince tabelle 1 e gidip ad ve soyadin oldugu tam satiri bulmasini istiyorum, degsiklik yapmak icin kodlarim var calisiyor, tek istedigim listboxtda listelenmis herhangi bir ismi cift tikladiginda onu tabelle1 de ad ve soyadi dogrulayarak bulmasi ve textbox a getirmesi.

Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Tabelle1")

Dim lastRow As Long
lastRow = ws.Cells(ws.Rows.Count, "B").End(xlUp).Row

Dim i As Long
For i = 2 To lastRow ' Başlık varsa 2'den başlıyoruz
If ws.Cells(i, "B").Value = vbNachname.Value And ws.Cells(i, "C").Value = vbVorname.Value Then
ws.Cells(i, "B").Select ' İsterseniz burada sadece veri işlemi de yapabilirsiniz
Exit Sub
End If
Next i

Bitir:
MsgBox "Der gesuchte Datensatz konnte nicht gefunden werden"

End Sub
Merhaba, şu şekilde dener misiniz;

Kod:
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    On Error GoTo Bitir

    vbDatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 0), "dd.mm.yyyy")
    vbNachname.Value = ListBox1.List(ListBox1.ListIndex, 1)  ' Soyad
    vbVorname.Value = ListBox1.List(ListBox1.ListIndex, 2)   ' Ad
    vbPassnummer.Value = ListBox1.List(ListBox1.ListIndex, 3)
    vbGbdatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 4), "dd.mm.yyyy")
    vbFreigabe.Value = ListBox1.List(ListBox1.ListIndex, 5)
    vbZahlungsmethode.Value = ListBox1.List(ListBox1.ListIndex, 6)
    vbZahlungsdatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 7), "dd.mm.yyyy")

    Dim ws As Worksheet
    Set ws = ThisWorkbook.Sheets("Tabelle1")
    ws.Activate
    
    Dim lastRow As Long
    lastRow = ws.Cells(ws.Rows.Count, "B").End(xlUp).Row
    
    Dim bulundu As Boolean
    bulundu = False
    
    Dim i As Long
    For i = 2 To lastRow
        If ws.Cells(i, "B").Value = vbNachname.Value And ws.Cells(i, "C").Value = vbVorname.Value Then
            ws.Cells(i, "B").Select
            bulundu = True
            Exit For
        End If
    Next i
    
    If Not bulundu Then
        GoTo Bitir
    End If
    
    Exit Sub
    
Bitir:
    MsgBox "Der gesuchte Datensatz konnte nicht gefunden werden"
End Sub
 
Katılım
20 Haziran 2011
Mesajlar
29
Excel Vers. ve Dili
Microsoft 365 Deutsch
Merhaba, şu şekilde dener misiniz;

Kod:
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    On Error GoTo Bitir

    vbDatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 0), "dd.mm.yyyy")
    vbNachname.Value = ListBox1.List(ListBox1.ListIndex, 1)  ' Soyad
    vbVorname.Value = ListBox1.List(ListBox1.ListIndex, 2)   ' Ad
    vbPassnummer.Value = ListBox1.List(ListBox1.ListIndex, 3)
    vbGbdatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 4), "dd.mm.yyyy")
    vbFreigabe.Value = ListBox1.List(ListBox1.ListIndex, 5)
    vbZahlungsmethode.Value = ListBox1.List(ListBox1.ListIndex, 6)
    vbZahlungsdatum.Value = Format(ListBox1.List(ListBox1.ListIndex, 7), "dd.mm.yyyy")

    Dim ws As Worksheet
    Set ws = ThisWorkbook.Sheets("Tabelle1")
    ws.Activate
   
    Dim lastRow As Long
    lastRow = ws.Cells(ws.Rows.Count, "B").End(xlUp).Row
   
    Dim bulundu As Boolean
    bulundu = False
   
    Dim i As Long
    For i = 2 To lastRow
        If ws.Cells(i, "B").Value = vbNachname.Value And ws.Cells(i, "C").Value = vbVorname.Value Then
            ws.Cells(i, "B").Select
            bulundu = True
            Exit For
        End If
    Next i
   
    If Not bulundu Then
        GoTo Bitir
    End If
   
    Exit Sub
   
Bitir:
    MsgBox "Der gesuchte Datensatz konnte nicht gefunden werden"
End Sub
Merhaba maalesef arama yapmiyor
 
Üst