If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Multi Select ListBox does not post 1 selection

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-01-06, 10:14
kwengerd kwengerd is offline
Registered User
 
Join Date: Mar 2005
Posts: 11
Multi Select ListBox does not post 1 selection

I thought this code was working ok, but just realized that if I select one item or a list of items, the first one is not listed. What am I missing? Here's my code:

Dim I As Long
Dim X As Long
X = 13
For I = 10 To ListBox10.ListCount - 1
If ListBox10.Selected(I) Then

X = X + 1
Range("M" & X) = ListBox10.List(I)
End If
Next I
Reply With Quote
  #2 (permalink)  
Old 06-01-06, 13:03
norie norie is offline
Registered User
 
Join Date: Mar 2006
Posts: 163
Why do you have 10 in the for statement?

That means you'll start at the 11th (because the listbox is zero-based) item.
Reply With Quote
  #3 (permalink)  
Old 06-02-06, 03:18
MikeTheBike MikeTheBike is offline
Registered User
 
Join Date: Apr 2004
Location: Derbyshire, UK
Posts: 714
Hi

Folowing on from norie's prompt I suspect you need this

Code:
Dim I As Long
Dim X As Long
X = 13
For I = 0 To ListBox10.ListCount - 1
    If ListBox10.Selected(I) Then
        X = X + 1
        Range("M" & X) = ListBox10.List(I)
    End If
Next I
you probable had

For I = 1 To ListBox10.ListCount - 1 ???

HTH

MTB
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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