• DİKKAT

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

User Formla İstenen Satıra Gitme

Katılım
20 Ocak 2006
Mesajlar
205
Herkese hayırlı ramazanlar ve iyi geceler. Siz üstadlardan aldığım bir user form çalışmasında listeden bulduğum ismin üzerine tıkladığımda o kişi ile ilgili olan bilgiler alttaki TextBox'lara gelsin istiyorum. Ayrıca bu bilgilerde değişiklik yapabileyim. Yardımcı olmak isteyen arkadaşlarıma şimdiden teşekkür ederim.
 

Ekli dosyalar

Listboxun click olayına;

Kod:
Private Sub ogbulListBox_Click()
ogbulComboxad.ListIndex = ogbulListBox.ListIndex
ogbuladsoyad.Caption = ogbulListBox.List(ogbulListBox.ListIndex, 0) & " " & ogbulListBox.List(ogbulListBox.ListIndex, 1)

[COLOR="Red"]s = ogbulListBox.ListIndex + 2
TextBox1.Text = Sheets("22").Cells(s, 1).Value
TextBox2.Text = Sheets("22").Cells(s, 2).Value
TextBox3.Text = Sheets("22").Cells(s, 3).Value[/COLOR]
End Sub

yada,

Kod:
Private Sub ogbulListBox_Click()
ogbulComboxad.ListIndex = ogbulListBox.ListIndex
ogbuladsoyad.Caption = ogbulListBox.List(ogbulListBox.ListIndex, 0) & " " & ogbulListBox.List(ogbulListBox.ListIndex, 1)
[COLOR="red"]Set bul = Sheets("22").Range("b:b").Find(ogbulListBox.List(ogbulListBox.ListIndex, 1))
If Not bul Is Nothing Then
TextBox1.Text = Sheets("22").Cells(bul.Row, 1)
TextBox2.Text = Sheets("22").Cells(bul.Row, 2)
TextBox3.Text = Sheets("22").Cells(bul.Row, 3)
End If[/COLOR]
End Sub

iyi çalışmalar.
 
Kod:
Private Sub ogbulComboxad_Change()
ogbulListBox.ListIndex = ogbulComboxad.ListIndex
If ogbulListBox.ListIndex = -1 Then
ogbuladsoyad.Caption = ""
Else
ogbuladsoyad.Caption = ogbulListBox.List(ogbulListBox.ListIndex, 0) & " " & ogbulListBox.List(ogbulListBox.ListIndex, 1)
End If
End Sub

Private Sub ogbulComboxnum_Change()
ogbulListBox.ListIndex = ogbulComboxnum.ListIndex
If ogbulListBox.ListIndex = -1 Then
ogbuladsoyad.Caption = ""
ogbulSatir.Enabled = False
ogbulSayfa.Enabled = False
Else
ogbuladsoyad.Caption = ogbulListBox.List(ogbulListBox.ListIndex, 0) & " " & ogbulListBox.List(ogbulListBox.ListIndex, 1)
End If
End Sub

Private Sub ogbulKapat_Click()
Unload Me

End Sub
Private Sub ogbulKriter_Change()
ogbulComboxnum.Value = ""
ogbulComboxad.Value = ""
ogbulListBox.Value = ""
ogbuladsoyad.Caption = ""
ogbulSatir.Enabled = False
ogbulSayfa.Enabled = False
End Sub
Private Sub ogbulListBox_Click()
ogbulComboxad.ListIndex = ogbulListBox.ListIndex
ogbuladsoyad.Caption = ogbulListBox.List(ogbulListBox.ListIndex, 0) & " " & ogbulListBox.List(ogbulListBox.ListIndex, 1)
TextBox1 = Cells(ogbulListBox.ListIndex + 2, 1)
TextBox2 = Cells(ogbulListBox.ListIndex + 2, 2)
TextBox3 = Cells(ogbulListBox.ListIndex + 2, 3)
End Sub

Private Sub TextBox1_Change()
 Cells(ogbulListBox.ListIndex + 2, 1) = TextBox1.Text
End Sub
Private Sub TextBox2_Change()
 Cells(ogbulListBox.ListIndex + 2, 2) = TextBox2.Text
End Sub
Private Sub TextBox3_Change()
 Cells(ogbulListBox.ListIndex + 2, 3) = TextBox3.Text
End Sub

Private Sub UserForm_Activate()
Dim son
son = Worksheets("22").Range("A65536").End(xlUp).Row
ogbulListBox.RowSource = "22!A2:B" & son
ogbulComboxad.RowSource = "22!B2:B" & son

End Sub



Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
   If CloseMode = vbFormControlMenu Then
      MsgBox "Üzgünüm ama programda bu şekilde çıkamazsınız!", vbOKOnly, "PROGRAMDAN ÇIK BUTONUNU KULLANIN LÜTFEN"
      Cancel = True
   End If
End Sub
eski kodları bunlarla değiştirin.
 
Sn Fedeal ve Hamitcan . Her ikinize , vermiş olduğunuz yardımlarden dolayı çok teşekkür ederim.
 
Geri
Üst