title: Clear items selected from ListBox
body: <p>I am trying to create a simple form using an Excel macro. This form will be used to input data which will be stored in Sheet2.  Once the data has been saved, I would like to clear the contents from the form.  I have been able to achieve this for most of the input boxes except for listbox.  Below is the code that through which I am trying to achieve this functionality. </p>
  
  <pre><code>     Dim clearlstbox As Long
  
        With AOI
         For clearlstbox = .ListCount - 1 To 0 Step -1
           If .Selected(clearlstbox) = True Then
          .RemoveItem clearlstbox
           End If
         Next clearlstbox
        End With
  
     '
     'For clearlstbox = AOI.ListCount - 1 To 0 Step -1
     '    If AOI.Selected(clearlstbox) = True Then
     '        AOI.RemoveItem (clearlstbox)
     '    End If
     'Next
  </code></pre>
  
  <p>With both the codes it throws a similar error message "runtime error '-2147467259 (80004005) unspecified error"</p>