+ Reply to Thread
Results 1 to 2 of 2

Having problems populating a multicolumn listbox changing Listbox column with a loop.

  1. #1
    Registered User
    Join Date
    07-01-2013
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Unhappy Having problems populating a multicolumn listbox changing Listbox column with a loop.

    Hi, Im trying to make a program that takes a value inside a cell and starts a loop from 1 to that value. Inside the loop, the listbox should get populated with different values inside a sheet and with a number of lines that's equal to the value taken before. Many im not explaining myself, I've got to succesfully populate my listbox with multicolumns for just one line, but when I try to achieve more than one line, the listbox replace the data already added with the new one that is intended to be in another line. This is the code im using right now:

    --------------------------------------------------------------------------------------------------------------------------

    Please Login or Register  to view this content.
    --------------------------------------------------------------------------------------------------------------------------
    When I execute it, the listbox that is intended to be filled with "f" number of lines, has only one, filled with the last data taken by the program. I believe the problem is inside the ".Column(0, b - 1)", where I thought the line would change depending on the value "b" has inside the loop. Sadly it didn't work. Any help would be greatly appreciated!
    Last edited by Leith Ross; 07-11-2013 at 12:35 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Having problems populating a multicolumn listbox changing Listbox column with a loop.

    Hello Aristizabal95,

    You need to move the Clear method out of the loop. Execute this before you enter the loop.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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