首页 > 其他分享 >vba-传递listbox作为参数

vba-传递listbox作为参数

时间:2022-12-05 14:36:21浏览次数:43  
标签:Function vba End Sub Selected 参数 lb 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

 

标签:Function,vba,End,Sub,Selected,参数,lb,listbox
From: https://www.cnblogs.com/Insist-Y/p/16952172.html

相关文章