Hi everyone:

I'm new in this forum and I would like to know if you can help me with this issue:

My code is this:

Private Sub ListBox1_Change()
Dim a As Long


If ListBox1.Selected(0) = True Then
For a = 1 To listobox1.ListCount
ListBox1.Selected(a) = True
Next
End If

End Sub

What I'm trying to do is a select all / deselect all checkbox inside listbox, I already create the checkbox and call the lines of code from the listbox change method, the trouble I have is when a = 1 check the next item in the list but instead to advance to the next a making its value 2, what it does is jumping back to the name of the sub routine. Making and endless loop.

Any idea what is wrong?