Reset listbox selection in VBA

前端 未结 5 516
渐次进展
渐次进展 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:34

    To reset the apparent item selected in the listbox, try:

    ListBox1.ListIndex = -1
    ListBox2.ListIndex = -1
    

    There will be no apparent item in the listbox control after that.

提交回复
热议问题