LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Building an Array

Excel 2002, WinXP
I have a problem building this array.
I have a UserForm with a ListBox.
The ListBox can have multiple items.
The list for the ListBox consists of one item this time.
The ListBox is setup for multiple selections.
The user selects the only item.
The statement "If UFNoMgtFee.lbNMFee.Selected(j) returns False, so no array
gets built.
What am I doing wrong?


Sub BuildArray()
ReDim MyArray(1 To 1000)
Co = 0
If UFNoMgtFee.lbNMFee.ListIndex = -1 Then
Msg = "Nothing"
Unload UFNoMgtFee
Else
Msg = ""
MsgBox "Hello" 'I get a Hello here so at least one item has been
selected
For j = 0 To UFNoMgtFee.lbNMFee.ListCount - 1
If UFNoMgtFee.lbNMFee.Selected(j) Then
Msg = Msg & UFNoMgtFee.lbNMFee.List(j) & vbCrLf
Co = Co + 1
MyArray(Co) = UFNoMgtFee.lbNMFee.List(j)
End If
Next j
End If
If Co = 0 Then Exit Sub
ReDim Preserve MyArray(1 To Co)
'Work with the array
End Sub


 
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
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
Building a TOC phil1ray Excel Discussion (Misc queries) 2 February 10th 06 02:46 PM
Building Formulas Shawn K Excel Worksheet Functions 2 November 11th 05 12:06 AM
Building/Creating an Array Rich Cooper Excel Programming 8 May 26th 04 06:57 PM
Building xll No Name Excel Programming 2 February 28th 04 06:25 PM


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