MultiSelect ListBox’da Rastgele Seçilen Verileri Elde Etmek


Private Sub MltSlctVeriAl()

Dim tmpArray() As Variant
Dim selCount As Integer

selCount = -1

For i = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) = True Then
selCount = selCount + 1
End If
Next
ReDim Preserve tmpArray(selCount, Me.ListBox1.ColumnCount - 1)

For i = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) = True Then
k = k + 1
For j = 0 To Me.ListBox1.ColumnCount - 1
tmpArray(k - 1, j) = Me.ListBox1.List(i, j)
Next
End If
Next

End Sub

Verileri diziye aktardıktan sonra ne yapmak istediğiniz size kalmış. 🙂

Paylaşmayı unutmayın!
0 0 votes
Article Rating
Subscribe
Bildir
guest
0 Yorum
Inline Feedbacks
View all comments