'反选 Private Sub CommandButton1_Click() Call Testss(Me!TIListBox) End Sub Private Function Testss(ByRef lb As Object) If lb.ListCount < 1 Then MsgBox "请先获取数据表字段" Exit Function End If Dim i As Integer For i = 0 To lb.ListCount - 1 If lb.Selected(i) = True Then lb.Selected(i) = False Else lb.Selected(i) = True End If Next End Function
标签:Function,vba,End,Sub,Selected,参数,lb,listbox From: https://www.cnblogs.com/Insist-Y/p/16952172.html