• DİKKAT

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

ComboBoxta Listeleme sorunu

numan şamil

Destek Ekibi
Destek Ekibi
Katılım
27 Ocak 2011
Mesajlar
1,238
Excel Vers. ve Dili
Ofis 2013 Türkçe
Merhaba Arkadaşlar
Benim sorunum;
Ekli dosyada
UserForumda ComboBox2 de İsim olarak AHMET seçildiğinde AHMET' e ait 1455 ve 1455-A seri no larının her ikisinide ComboBox2 nasıl gösterebilirim veya ComboBox2 de listelenen sıraya göre ilk satırdaki AHMET'i seçtiğimde 1455 altındaki AHMET'i seçtiğimde 1455-A ComboBox1 'e nasıl getirebilirim bunun için kodlarda ne gibi düzenleme yapmalıyım
Not: satırdaki yerleri değişe biliyor
Herkese iyi çalışmalar
 

Ekli dosyalar

Son düzenleme:
Merhaba Arkadaşlar
Benim sorunum;
Ekli dosyada
UserForumda ComboBox2 de İsim olarak AHMET seçildiğinde AHMET' e ait 1455 ve 1455-A seri no larının her ikisinide ComboBox2 nasıl gösterebilirim veya ComboBox2 de listelenen sıraya göre ilk satırdaki AHMET'i seçtiğimde 1455 altındaki AHMET'i seçtiğimde 1455-A ComboBox1 'e nasıl getirebilirim bunun için kodlarda ne gibi düzenleme yapmalıyım
Not: satırdaki yerleri değişe biliyor
Herkese iyi çalışmalar

Merhaba
Userform'un kod bölümüne
Kod:
Option Explicit
Private Sub ComboBox1_Change()
'Konu       :   Seçimlere Göre Verileri Çıkart
'Mail       :   m.batu.1967@gmail.com
'Msn        :   m.batu.1967@hotmail.com.tr
'Coder By   :   asi_kral_1967
Dim asi As Long
For asi = 3 To Cells(Rows.Count, "B").End(xlUp).Row
If Cells(asi, "B") = ComboBox2 And Cells(asi, "A").Text = ComboBox1 Then
TextBox1.Value = Cells(asi, "C").Value
TextBox2.Value = Cells(asi, "D").Value
TextBox3.Value = Cells(asi, "E").Value
TextBox4.Value = Cells(asi, "F").Value
End If: Next
End Sub
Private Sub ComboBox2_Change()
'Konu       :   Combobox2'den Seçilen İsme Göre Sıra Noyu Seçtir
'Mail       :   m.batu.1967@gmail.com
'Msn        :   m.batu.1967@hotmail.com.tr
'Coder By   :   asi_kral_1967
Dim asi As Long, kral As New Collection, a As Range
On Error Resume Next
For asi = 3 To Cells(Rows.Count, "B").End(xlUp).Row
If Cells(asi, "B") = ComboBox2 Then
kral.Add Cells(asi, "A"), CStr(Cells(asi, "A"))
End If: Next
ComboBox1.Clear
For Each a In kral
ComboBox1.AddItem a
Next
End Sub
Private Sub UserForm_Initialize()
'Konu       :   Combobox2'e İsimleri Listele
'Mail       :   m.batu.1967@gmail.com
'Msn        :   m.batu.1967@hotmail.com.tr
'Coder By   :   asi_kral_1967
Dim asi As Long
For asi = 3 To Cells(Rows.Count, "B").End(xlUp).Row
If WorksheetFunction.CountIf(Range("B3:B" & asi), Cells(asi, "B")) = 1 Then
ComboBox2.AddItem Cells(asi, "B"): End If: Next
End Sub
Bu kodları kopyalayın. Diğer kodların tamamını silin.
Combobox2'den yaptığınız seçim'e göre çalışacaktır.
Dosyanız Ekte.
 

Ekli dosyalar

Son düzenleme:
Merhaba
Userform'un kod bölümüne
Kod:
Option Explicit
Private Sub ComboBox1_Change()
'Konu       :   Seçimlere Göre Verileri Çıkart
'Mail       :   m.batu.1967@gmail.com
'Msn        :   m.batu.1967@hotmail.com.tr
'Coder By   :   asi_kral_1967
Dim asi As Long
For asi = 1 To Cells(Rows.Count, "B").End(xlUp).Row
If Cells(asi, "B") = ComboBox2 And Cells(asi, "A") = ComboBox1 Then
TextBox1.Value = Cells(asi, "C").Value
TextBox2.Value = Cells(asi, "D").Value
TextBox3.Value = Cells(asi, "E").Value
TextBox4.Value = Cells(asi, "F").Value
End If: Next
End Sub
Private Sub ComboBox2_Change()
'Konu       :   Combobox2'den Seçilen İsme Göre Sıra Noyu Seçtir
'Mail       :   m.batu.1967@gmail.com
'Msn        :   m.batu.1967@hotmail.com.tr
'Coder By   :   asi_kral_1967
Dim asi As Long, kral As New Collection, a As Range
On Error Resume Next
For asi = 3 To Cells(Rows.Count, "B").End(xlUp).Row
If Cells(asi, "B") = ComboBox2 Then
kral.Add Cells(asi, "A"), CStr(Cells(asi, "A"))
End If: Next
ComboBox1.Clear
For Each a In kral
ComboBox1.AddItem a
Next
End Sub
Private Sub UserForm_Initialize()
'Konu       :   Combobox2'e İsimleri Listele
'Mail       :   m.batu.1967@gmail.com
'Msn        :   m.batu.1967@hotmail.com.tr
'Coder By   :   asi_kral_1967
Dim asi As Long
For asi = 3 To Cells(Rows.Count, "B").End(xlUp).Row
If WorksheetFunction.CountIf(Range("B3:B" & asi), Cells(asi, "B")) = 1 Then
ComboBox2.AddItem Cells(asi, "B"): End If: Next
End Sub
Bu kodları kopyalayın. Diğer kodların tamamını silin.
Combobox2'den yaptığınız seçim'e göre çalışacaktır.
Dosyanız Ekte.

Merhaba
Öncelikle ilginize teşekkür ederim
Ekte gönderdiğiniz dosyayı inceledim
ComboBox2 de İsim olarak AHMET seçildiğinde AHMET' e ait 1455 ve 1455-A seri no larının her ikisinide ComboBox2 de görebiliyorum
Ancak sadece 1455-A seçildiğinde TextBox 'lara veriler geliyor veya 1455 seçildiğinde veya diğer isim ve no'lar seçildiğinde Örn:Hasan - 1975 seçildiğinde TextBox 'lara veriler gelmiyor
Bakabilirmisiniz? Benmi yanılıyorum acaba?
 
Merhaba
Öncelikle ilginize teşekkür ederim
Ekte gönderdiğiniz dosyayı inceledim
ComboBox2 de İsim olarak AHMET seçildiğinde AHMET' e ait 1455 ve 1455-A seri no larının her ikisinide ComboBox2 de görebiliyorum
Ancak sadece 1455-A seçildiğinde TextBox 'lara veriler geliyor veya 1455 seçildiğinde veya diğer isim ve no'lar seçildiğinde Örn:Hasan - 1975 seçildiğinde TextBox 'lara veriler gelmiyor
Bakabilirmisiniz? Benmi yanılıyorum acaba?

Üstteki kodu güncelledim ayrıca dosyayı da güncelledim.
 
Geri
Üst