Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ListBox Performance (XL97: SR2)

    I have a listbox1 that contain approximately 2000 items and based on the select, copies them to listbox2. There are some instances where I want to select all items from listbox1 and copy to listbox2. This works great while the calculation is set to automatic however it is quite slow. Too slow. If I set the calculation to manual I can only copy the first item of listbox1 to listbox2.

    Am I missing something?

    John

  2. #2
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Silicon Valley, California, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ListBox Performance (XL97: SR2)

    Hello,

    Some questions:
    * Are the list boxes from the "Forms" toolbar or from the "Control Toolbox" toolbar?
    * Can you post the code you are using to copy the selected items from Listbox1 to Listbox2?
    * Are there any worksheet cells that depend on the linked cells to Listbox2?
    * Do you have similar performance issue if you select virtually all (but not quite all) items in Listbox1 and copy to Listbox2?

    JIM

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ListBox Performance (XL97: SR2)

    Jim,

    A sample file is attached. The listboxes are generated from a Userform on the VBA project screen.

    Thanks for taking the time out to look at it.
    John

  4. #4
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Silicon Valley, California, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ListBox Performance (XL97: SR2)

    Hello John,

    See attached sample file, I think these approaches will help. The main points are:
    * Avoid looping, it takes time
    * ListBoxes and ranges are natural compliments, there are "built-in" methods of sharing contents between the two. These methods are much quicker.

    If you have any questions about it, let me know.

Posting Permissions

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