Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 204
Default Nothing selected in my list box?

Hello, I need to find out if the user has selected anything in my
multi-select1 list box, I am currently using

If lbxHeadings.ListIndex = 0 Then

but that is true if nothing is selected or if only the first item is
selected.

If I set option base1 will that allow me to distinguish between nothing
selected and the first item?

Is there an easier way, as option-base1 will mean a rewrite of lots of my
values throughout too?
Thanks

Michelle

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default Nothing selected in my list box?

Hi.
You should use :

With Sheet1.ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) Then
'code
End If
Next i
End With

HTH
Daniel

Hello, I need to find out if the user has selected anything in my
multi-select1 list box, I am currently using

If lbxHeadings.ListIndex = 0 Then

but that is true if nothing is selected or if only the first item is
selected.

If I set option base1 will that allow me to distinguish between nothing
selected and the first item?

Is there an easier way, as option-base1 will mean a rewrite of lots of my
values throughout too?
Thanks

Michelle



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
List and subtotal selected items, then print separate item list TitanG Excel Worksheet Functions 0 September 8th 08 09:07 PM
using selected data within a dropdown list to populate new list Roger on Excel Excel Programming 0 November 16th 07 07:55 PM
A validated List which link to selected cells according to what is selected on the list WL Excel Worksheet Functions 1 June 5th 06 08:52 PM
Last list item selected in a Multi-Select list box? Brian Excel Programming 3 December 5th 05 09:12 PM
Populating dropdown list 2 with data depending upon what was selected in list 1 karambos Excel Programming 2 November 9th 04 05:32 PM


All times are GMT +1. The time now is 04:15 PM.

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

About Us

"It's about Microsoft Excel"