Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Formula or access ? taxmom Excel Worksheet Functions 9 June 16th 06 06:20 PM
Help with Excel ActiveX listbox controls programmer123 Excel Discussion (Misc queries) 0 July 7th 05 10:30 PM
Perform oiperations relative to initial selected cell scratching my head Excel Discussion (Misc queries) 1 May 30th 05 05:42 PM


All times are GMT +1. The time now is 06:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"