- Katılım
- 12 Eylül 2004
- Mesajlar
- 871
- Excel Vers. ve Dili
-
Excel 2019 Türkçe (Ev)
Excel 2013 Türkçe (Okul)
Birinci ComboBoxtaki kodum;
UserForm İntialize kodum;
Forma geçişten sonra ilk girişte ComboBox2 ye bağlı olarak ComboBox4 ve ComboBox5'e veriler filtrelenmiş olarak geliyor.Ancak ikinci kayıttan itibaren ComboBox5'teki liste filtre olmuyor.
Kod:
Private Sub ComboBox2_Change()
Dim c As Range, _
s1 As Worksheet, _
Adr As String
ComboBox4.Clear
Set s1 = Sheets("DERS_KONU_KAZANIM")
With s1.Range("A:A")
Set c = .Find(ComboBox2.Value, LookIn:=xlValues)
If Not c Is Nothing Then
Adr = c.Address
Do
ComboBox4.AddItem s1.Cells(c.Row, "B")
ComboBox5.AddItem s1.Cells(c.Row, "C")
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> Adr
End If
End With
End Sub
Kod:
Private Sub UserForm_Initialize()
Dim Say, i As Integer, s1 As Worksheet
Say = WorksheetFunction.CountA(Worksheets("ÖDEV_VERİTABANI").Range("A:A"))
ListBox1.RowSource = "ÖDEV_VERİTABANI!A2:H" & Say
ListBox1.ColumnCount = 8
Set s1 = Sheets("DERS_KONU_KAZANIM")
For i = 1 To s1.Cells(Rows.Count, "A").End(3).Row
ComboBox2.AddItem s1.Cells(i, "A")
Next i
End Sub