Results 1 to 10 of 10

Add Listbox Values to an Array

Threaded View

  1. #1
    Forum Contributor
    Join Date
    11-27-2009
    Location
    Oxford
    MS-Off Ver
    Excel 2003, 2007 and 2010
    Posts
    120

    Thumbs up Add Listbox Values to an Array

    Hey all,

    I have two listboxes the user selects the value from one listbox and puts it to the next listbox. i then want to run a code to look through the second listbox and add each item in the listbox to an array.

    the code i have works if the user clicks on the first item in the listbox, but it doesnt work if they dont. i want it to work if the user hasnt clicked on the first item, i just want it to look through and get all values.

    Do Until COUNTER = 20
    
       ListBox2.ListIndex = COUNT
       Let NARY(COUNTER) = ListBox2.VALUE
           
        COUNTER = COUNTER + 1
        COUNT = COUNT + 1
        
    Loop
    I though that the ListBox2.ListIndex = COUNT would select an item and then would get the value from it but it doesnt seam to work.

    Thanks
    Last edited by t0m46; 08-17-2010 at 07:25 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1