Consulting

Results 1 to 3 of 3

Thread: Solved: Clearing a multi column listbox

  1. #1
    VBAX Contributor
    Joined
    Apr 2006
    Posts
    144
    Location

    Solved: Clearing a multi column listbox

    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 :

    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

  2. #2
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    [VBA]ListBox1.Clear[/VBA]?

  3. #3
    VBAX Contributor
    Joined
    Apr 2006
    Posts
    144
    Location
    Brilliant. Thanks Charlize.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •