- Katılım
- 24 Temmuz 2008
- Mesajlar
- 1,587
- Excel Vers. ve Dili
- Ofis 2013 TR 32 Bit
UserForm a aşağıdaki kodlarla süz yaptırıyorum.
Ancak Listbox tan seçim yaptığımda
Sayfadaki kayıta göre veri geliyor
Süz yaptığım için Listbox sıralaması ile Kayıt sıralaması farklı oluyor.
Sonuçta Textbox lara yanlış sıradan veri geliyor.
Sizlerden İstediğim :
Süz yaptıktan sonra
ListBox ta ki verilerden hangisini seçersem
O Veri yi Textbox ta görmek.
Private Sub ComboBox1_Change()
ListBox1.Clear
For suz = 1 To WorksheetFunction.CountA(Range("B2:B65536"))
If Range("B" & suz) Like ComboBox1 & "*" Then
ListBox1.AddItem
s = s + 1
ListBox1.List(s - 1, 0) = Range("B" & suz)
End If
Next
End Sub
Private Sub ListBox1_Click()
Cells(ListBox1.ListIndex + 2, 1).Select
TextBox1.Text = Cells(ActiveCell.Row, "B")
TextBox2.Text = Cells(ActiveCell.Row, "C")
TextBox3.Text = Cells(ActiveCell.Row, "D")
TextBox4.Text = Cells(ActiveCell.Row, "E")
TextBox5.Text = Cells(ActiveCell.Row, "F")
End Sub
Private Sub UserForm_Initialize()
ComboBox1 = 1
ComboBox1 = Empty
End Sub
TEŞEKKÜRLER...........
Ancak Listbox tan seçim yaptığımda
Sayfadaki kayıta göre veri geliyor
Süz yaptığım için Listbox sıralaması ile Kayıt sıralaması farklı oluyor.
Sonuçta Textbox lara yanlış sıradan veri geliyor.
Sizlerden İstediğim :
Süz yaptıktan sonra
ListBox ta ki verilerden hangisini seçersem
O Veri yi Textbox ta görmek.
Private Sub ComboBox1_Change()
ListBox1.Clear
For suz = 1 To WorksheetFunction.CountA(Range("B2:B65536"))
If Range("B" & suz) Like ComboBox1 & "*" Then
ListBox1.AddItem
s = s + 1
ListBox1.List(s - 1, 0) = Range("B" & suz)
End If
Next
End Sub
Private Sub ListBox1_Click()
Cells(ListBox1.ListIndex + 2, 1).Select
TextBox1.Text = Cells(ActiveCell.Row, "B")
TextBox2.Text = Cells(ActiveCell.Row, "C")
TextBox3.Text = Cells(ActiveCell.Row, "D")
TextBox4.Text = Cells(ActiveCell.Row, "E")
TextBox5.Text = Cells(ActiveCell.Row, "F")
End Sub
Private Sub UserForm_Initialize()
ComboBox1 = 1
ComboBox1 = Empty
End Sub
TEŞEKKÜRLER...........
