Aşağıdaki kodla Genel sayfasından aranılan veriyilistboxta bulup istenilen yerlere aktarıyorum. Bulunan TC noları sayfanın C kolonunda eğer TC nolarını sayfanın B kolonuna alırsak kodda nasıl bir değişiklik yapmalıyız,birtülü yapamadım.
Private Sub CommandButton1_Click()
Sheets("genel").Select
Dim i As Long, sat As Long
ListBox1.RowSource = ""
For i = 2 To [B5000].End(3).Row
If Cells(i, "C").Value = Val(TextBox1.Value) Then
ListBox1.AddItem
ListBox1.Column(0, sat) = Cells(i, "B").Value
ListBox1.Column(1, sat) = Cells(i, "C").Value
ListBox1.Column(2, sat) = Cells(i, "D").Value
ListBox1.Column(3, sat) = Cells(i, "E").Value
ListBox1.Column(4, sat) = Cells(i, "F").Value
ListBox1.Column(5, sat) = Cells(i, "G").Value
ListBox1.Column(6, sat) = Cells(i, "H").Value
ListBox1.Column(7, sat) = Cells(i, "I").Value
sat = sat + 1
End If
Next i
If ListBox1.ListCount = 0 Then MsgBox [TextBox1] & " " & "Nolu TC Kimlik numarasına Kayıtlarımızda rastlanmamıştır."
TextBox1 = " "
End Subamadım.
Private Sub CommandButton1_Click()
Sheets("genel").Select
Dim i As Long, sat As Long
ListBox1.RowSource = ""
For i = 2 To [B5000].End(3).Row
If Cells(i, "C").Value = Val(TextBox1.Value) Then
ListBox1.AddItem
ListBox1.Column(0, sat) = Cells(i, "B").Value
ListBox1.Column(1, sat) = Cells(i, "C").Value
ListBox1.Column(2, sat) = Cells(i, "D").Value
ListBox1.Column(3, sat) = Cells(i, "E").Value
ListBox1.Column(4, sat) = Cells(i, "F").Value
ListBox1.Column(5, sat) = Cells(i, "G").Value
ListBox1.Column(6, sat) = Cells(i, "H").Value
ListBox1.Column(7, sat) = Cells(i, "I").Value
sat = sat + 1
End If
Next i
If ListBox1.ListCount = 0 Then MsgBox [TextBox1] & " " & "Nolu TC Kimlik numarasına Kayıtlarımızda rastlanmamıştır."
TextBox1 = " "
End Subamadım.