av8tordude
05-29-2009, 06:59 AM
I have 2 listbox in a userform. The code below is to un-tick all ticked items in both list boxes. The code works well, but in an effort to write effiecient coding, I would combine the two coding into one. Can someone provide some assistance?
With Me.ACLIST
EnableEvents = True
For j = 0 To .ListCount - 1
If j = .ListCount - 1 Then EnableEvents = False
.Selected(j) = False
Call ResetLB
Next
End With
With Me.APPCH
EnableEvents = True
For j = 0 To .ListCount - 1
If j = .ListCount - 1 Then EnableEvents = False
.Selected(j) = False
Next
End With
With Me.ACLIST
EnableEvents = True
For j = 0 To .ListCount - 1
If j = .ListCount - 1 Then EnableEvents = False
.Selected(j) = False
Call ResetLB
Next
End With
With Me.APPCH
EnableEvents = True
For j = 0 To .ListCount - 1
If j = .ListCount - 1 Then EnableEvents = False
.Selected(j) = False
Next
End With