Friday, September 11, 2015

Filtering On Listbox And Copying Filtered Data

Filtering On Listbox And Copying Filtered Data

             You can filter in for each column with textbox and button. By selecting from the filtered data, you can copy it to other page (SelectedData Page).

You can multi-select (feature of "Select All") to copy.

Code of "Select All" on listbox with checkbox :
Private Sub CheckBox1_Click()
Dim r As Long
If CheckBox1.Value = True Then
ListBox2.MultiSelect = fmMultiSelectMulti
    For r = 0 To ListBox2.ListCount - 1
        ListBox2.Selected(r) = True
    Next r
   Else
   For r = 0 To ListBox2.ListCount - 1
        ListBox2.Selected(r) = False
   Next r
   End If
End Sub


1 comment: