Reset listbox selection in VBA

前端 未结 5 474
渐次进展
渐次进展 2021-01-18 18:08

I\'m trying to \'reset\' a listbox in Excel VBA when a form closes. Currently when I use the userform1.hide function the form disappears but when I open it up again using th

5条回答
  •  伪装坚强ぢ
    2021-01-18 18:37

    try this code to Clear listbox in VBA

    Private Sub clearListBox()
        Dim iCount As Integer
    
        For iCount = 0 To Me!ListBox1.ListCount
            Me!ListBox1.Selected(iCount) = False
        Next iCount
    End Sub
    

提交回复
热议问题