Accessing objects in VBA...

Essendon

Registered User.
Local time
Today, 04:40
Joined
Oct 25, 2001
Messages
65
Hi just a simple question that will help fix a problem and clear up my understanding of VBA.

given the following loop:

Dim i As Variant
For Each i In aList.ItemsSelected
...do stuff...
Next i

how do I access i? All I want to do is to deselect all the items in the list that are selected. I am used to Object Orient Programming, so automatically thought to put i.selected(false) where it says "do stuff", but no good. Could someone please tell me the correct syntax

Thanks
 
Dim ctl As Control
Dim VarItm As Variant

For Each VarItm In ctl.ItemsSelected
ctl.Selected(VarItm) = False
Next VarItm
 
Thankyou very much
 

Users who are viewing this thread

Back
Top Bottom