Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default excel - count sleected items in a listbox

Is it possible to count the SELECTED items of a ListBox


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default excel - count sleected items in a listbox

Try:

Sub CountSelected()
Dim LB As ListBox, i As Integer
Dim X As Integer
X = 0
Set LB = ActiveSheet.OLEObjects(1).Object
For i = 1 To LB.ListCount
If LB.Selected(i - 1) = True Then X = X + 1
Next
MsgBox X
End Sub

Regards,
Greg

-----Original Message-----
Is it possible to count the SELECTED items of a ListBox


---
Message posted from http://www.ExcelForum.com/

.

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
how to drag items within listbox MP Excel Discussion (Misc queries) 0 January 15th 09 03:56 PM
Listbox--moving items up or down libby Excel Programming 0 November 7th 03 06:53 PM
listing items from listbox Gerry[_5_] Excel Programming 2 October 18th 03 02:45 AM
Counting items in a listbox Thurman Excel Programming 0 September 5th 03 06:36 AM
Checking Listbox Items Tim[_15_] Excel Programming 1 July 20th 03 05:27 PM


All times are GMT +1. The time now is 09:04 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"