Home > Excel Tutorial > Using CheckBox to select all items in a ListBox

Using CheckBox to select all items in a ListBox

Using CheckBox to select all items in a ListBox

Codes :

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

To see example file Click Here

Using checkbox to select all items on listbox

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: