- Katılım
- 19 Mayıs 2007
- Mesajlar
- 86
- Excel Vers. ve Dili
- tr/2003
arkadaşlar bu ilk çalışmam...yapmak istediğim 2 combobox ın birbirine bilgileri tanıtmak dosya ekte şimdiden teşekkürler.
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Private Sub ComboBox1_Change()
Set s1 = Sheets("Veri")
sat = s1.Range("a1:a65536").Find(ComboBox1).Row
ComboBox1 = s1.Cells(sat, 1)
ComboBox2 = s1.Cells(sat, 2)
TextBox6 = s1.Cells(sat, 3)
TextBox1 = s1.Cells(sat, 5)
TextBox5 = s1.Cells(sat, 4)
End Sub
Private Sub ComboBox2_Change()
Set s1 = Sheets("Veri")
sat = s1.Range("b1:b65536").Find(ComboBox2).Row
ComboBox1 = s1.Cells(sat, 1)
ComboBox2 = s1.Cells(sat, 2)
TextBox6 = s1.Cells(sat, 3)
TextBox1 = s1.Cells(sat, 5)
TextBox5 = s1.Cells(sat, 4)
End Sub
Galiba şöyle bir şey istiyorsunuz: Mesela birinci kutuda Adana seçince, ikinci kutuda Adana'nın ilçeleri çıkacak.Arkadaşlar hazır konu açılmışken sormak istedim. Sn.Mahmutbeylinin örneğinde firma kodu aynı olupta farklı veriler içeren satırların bulunanması durumunda ikinci comboboxa sadece birinci comboboxta seçilen verinin bulunduğu diğer sütunlar tanıtılabilirmi.
inşallah anlatabilmişimdir. yani ilk combobox ile seçilen veri seçilen sayfada birden fazla ise ikinci comboboxta sadece bunların bulunduğu diğer sütun listelensin istiyorum.
Private Sub ComboBox1_Change()
ComboBox2.Clear
SAY = WorksheetFunction.CountIf([A:A], ComboBox1)
If SAY > 0 Then
SAYAÇ = 0
Set BUL = [A:A].Find(ComboBox1)
If Not BUL Is Nothing Then
ADRES = BUL.Address
Do
SAYAÇ = SAYAÇ + 1
ComboBox2.AddItem Cells(BUL.Row, 2)
If SAY = SAYAÇ Then GoTo Son
Set BUL = [A:A].FindNext(BUL)
Loop While Not BUL Is Nothing And BUL.Address <> ADRES
End If
End If
Son:
End Sub
Private Sub UserForm_Initialize()
For X = 5 To [A65536].End(3).Row
If WorksheetFunction.CountIf(Range("A4:A" & X), Cells(X, 1)) = 1 Then
ComboBox1.AddItem Cells(X, 1)
End If
Next
End Sub