vba-传递listbox作为参数
'反选 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