HighAndWilder
Active Member
- Joined
- Nov 4, 2006
- Messages
- 391
- Office Version
- 365
- Platform
- Windows
Happy New Year Everybody
I'm not quite as happy as I would like to be but if someone can help me sort this teaser out I'll be on my way....
I select an item in a listbox and then run some code.
I set the listindex to -1 and then to deselect the apparently selected item I loop through the items and set the Selected array to false irrespective of what the current value is.
The selected item still appears to be selected after the code is run but listindex is -1.
What also happens is that the code is run twice, once when I select the item and then again when the listindex is set to -1.
If I throw a message up using MsgBox after or before I deselect all items than none of the items appear selected.
Also if I select item 0, the first one, then none of the items are selected.
Any ideas anybody? Cheers.
I'm not quite as happy as I would like to be but if someone can help me sort this teaser out I'll be on my way....
I select an item in a listbox and then run some code.
I set the listindex to -1 and then to deselect the apparently selected item I loop through the items and set the Selected array to false irrespective of what the current value is.
The selected item still appears to be selected after the code is run but listindex is -1.
What also happens is that the code is run twice, once when I select the item and then again when the listindex is set to -1.
If I throw a message up using MsgBox after or before I deselect all items than none of the items appear selected.
Also if I select item 0, the first one, then none of the items are selected.
Any ideas anybody? Cheers.