Kod:
Private Sub ComboBox1_Change()
Dim k As Range, adrs As String, j As Byte, a As Long, myarr()
ReDim myarr(1 To 7, 1 To 1)
With Worksheets("DURUM")
Me.ListBox5.RowSource = vbNullString
'Show all records of Database on Sheet1
If .FilterMode Then .ShowAllData
Set k = .Range("A2:A65536").Find(ComboBox1.Text & "*", , xlValues, xlWhole)
If Not k Is Nothing Then
adrs = k.Address
Do
a = a + 1
ReDim Preserve myarr(1 To 7, 1 To a)
For j = 1 To 7
myarr(j, a) = .Cells(k.Row, j).Value
Next j
Set k = .Range("A2:A65536").FindNext(k)
Loop While Not k Is Nothing And k.Address <> adrs
ListBox5.Column = myarr
End If
End With
Sheets("DURUM").TextBox6.Value = Me.ComboBox1.Value
End Sub
ve
Kod:
Private Sub ComboBox4_Change()
Dim k As Range, adrs As String, j As Byte, a As Long, myarr()
ReDim myarr(1 To 7, 1 To 1)
With Worksheets("DURUM")
Me.ListBox5.RowSource = vbNullString
'Show all records of Database on Sheet1
If .FilterMode Then .ShowAllData
Set k = .Range("E2:E65536").Find(ComboBox4.Text & "*", , xlValues, xlWhole)
If Not k Is Nothing Then
adrs = k.Address
Do
a = a + 1
ReDim Preserve myarr(1 To 7, 1 To a)
For j = 1 To 7
myarr(j, a) = .Cells(k.Row, j).Value
Next j
Set k = .Range("E2:E65536").FindNext(k)
Loop While Not k Is Nothing And k.Address <> adrs
ListBox5.Column = myarr
End If
End With
Sheets("DURUM").TextBox2.Value = Me.ComboBox4.Value
End Sub
Yukarıdaki kodlar ile listboxda süzme işlemi gerçekleştiriyorum. Bunları birbirine bağlantılı olarak değiştirebilir miyiz? Başka kod mu lazım?
