View Full Version : Accessing objects in VBA...


Essendon
11-27-2001, 03:19 AM
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

Jack Cowley
11-27-2001, 05:07 AM
Dim ctl As Control
Dim VarItm As Variant

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

Essendon
11-27-2001, 11:34 PM
Thankyou very much