- Katılım
- 11 Şubat 2010
- Mesajlar
- 202
- Excel Vers. ve Dili
- 13 türkçe
Merhaba, şu iki kodu listboxta nasıl birleştirebilirim...Sadece listboxta isim seçince ikisi de ayrı çalışsın...Veya şu şekilde yardımcı olabilir misniz? Listboxta isim seçince hem userforma gelsin veriler hemde başka seçtiğim hücrelere gelsin.Teşekkürler
Kod:
Private Sub ListBox1_Click()
TextBox1 = ListBox1
For Each bul In Range("B1:B" & WorksheetFunction.CountA([b1:b65536]))
If StrConv(bul, vbUpperCase) = StrConv(TextBox1, vbUpperCase) Then
bul.Select
TextBox1 = ActiveCell.Offset(0, 0)
TextBox2 = ActiveCell.Offset(0, 1)
TextBox3 = ActiveCell.Offset(0, 2)
TextBox4 = ActiveCell.Offset(0, 3)
TextBox5 = ActiveCell.Offset(0, 4)
TextBox6 = ActiveCell.Offset(0, 5)
TextBox7 = ActiveCell.Offset(0, 6)
TextBox8 = ActiveCell.Offset(0, 7)
TextBox9 = ActiveCell.Offset(0, 8)
TextBox10 = ActiveCell.Offset(0, 9)
TextBox11 = ActiveCell.Offset(0, 10)
TextBox12 = ActiveCell.Offset(0, 11)
TextBox13 = ActiveCell.Offset(0, 12)
End If
Next
Kod:
Private Sub ListBox1_Click()
Dim bulx As Range
For Each bulx In Sayfa1.Range("b2:b" & Sayfa1.Range("b65536").End(3).Row)
If bulx.Value = ListBox1.Value Then
Range("T1") = bulx.Offset(0, 0).Value
Range("U1") = bulx.Offset(0, 1).Value
Range("V1") = bulx.Offset(0, 2).Value
Range("W1") = bulx.Offset(0, 3).Value
Range("X1") = bulx.Offset(0, 4).Value
Range("Y1") = bulx.Offset(0, 5).Value
Range("Z1") = bulx.Offset(0, 6).Value
Range("AA1") = bulx.Offset(0, 7).Value
Range("AB1") = bulx.Offset(0, 8).Value
Range("AC1") = bulx.Offset(0, 9).Value
Range("AD1") = bulx.Offset(0, 10).Value
Range("AE1") = bulx.Offset(0, 11).Value
Range("AF1") = bulx.Offset(0, 12).Value
End If
Next bulx
Set bulx = Nothing
End Sub
