roscoe
Well-known Member
- Joined
- Jun 4, 2002
- Messages
- 1,035
- Office Version
- 365
- Platform
- Windows
- MacOS
I have a list box that allows multiple sections. At some point I want to deselect all the items in the list (code below)
I'm getting a run-time error 1004 on the line with the arrow: "Unable to get the selected property of the Listbox class"
I got this code from online and it looks pretty simple...can't figure out why it's not working. "curlist.ListCount" returns the currect value so I know curlist is being assigned properly...
Ideas?
Thanks!
I'm getting a run-time error 1004 on the line with the arrow: "Unable to get the selected property of the Listbox class"
I got this code from online and it looks pretty simple...can't figure out why it's not working. "curlist.ListCount" returns the currect value so I know curlist is being assigned properly...
Code:
Set curlist = sheets("main").Listboxes("List Box 72")
For i = 0 To curlist.ListCount - 1
If curlist.Selected(i) = True Then <-------------------
curlist.Selected(i) = False
End If
Next
Ideas?
Thanks!