How to set the selected state of an embedded ActiveX listbox
Hi,
Trying to select every item in an embedded listbox. Any thoughts on how to correct the following? Thanks in advance. Private Sub btnSelectAll_Click() Dim i As Integer With Sheets("Sheet1").OLEObjects("lstList").Object For i = 1 To .ListCount .Selected(i) = True Next i End With End Sub |
How to set the selected state of an embedded ActiveX listbox
Don't bother, I figured it out. Base 0.
With Sheets("Sheet").OLEObjects("lstList").Object For i = 0 To .ListCount - 1 .Selected(i) = True Next i End With |
All times are GMT +1. The time now is 11:55 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com