PDA

View Full Version : Solved: Clearing a multi column listbox



Digita
09-03-2007, 09:51 PM
Hi there,

After populating a listbox with 3 column of data, I would like to remove all the items from the listbox. I tried the following codes without success :banghead: :



Sub ClearAll()
ListBox1.RemoveAllItems
End Sub



Sub ClearListBox()
Dim i As Integer
For i = 1 To ListBox1.ListCount
ListBox1.RemoveItem 0
Next i
End Sub

The latter code seems to work on a single column listbox only. Would someone come up with a code to clear the listbox? Thanks in advance.

Regards


KP

Charlize
09-03-2007, 11:35 PM
ListBox1.Clear?

Digita
09-03-2007, 11:43 PM
Brilliant. Thanks Charlize.