Hello,
I'm trying to sett all list boxes to the first item with the following code:
For Each Lbox In Me.Controls
If TypeOf Lbox Is MSForms.ListBox Then Lbox.ListIndex = 0
Next Lbox
Getting the error "could not set listindex. Invalid property." Not sure why since Me.listboxname.ListIndex=0 works fine alone.
I'm trying to sett all list boxes to the first item with the following code:
For Each Lbox In Me.Controls
If TypeOf Lbox Is MSForms.ListBox Then Lbox.ListIndex = 0
Next Lbox
Getting the error "could not set listindex. Invalid property." Not sure why since Me.listboxname.ListIndex=0 works fine alone.