+ Reply to Thread
Results 1 to 6 of 6

Slow vba cell update with listbox.

  1. #1
    Registered User
    Join Date
    10-19-2012
    Location
    Assen
    MS-Off Ver
    Excel 2010
    Posts
    81

    Slow vba cell update with listbox.

    Hi everyone.

    I'm working on a script for a while know. Everything works fine except that the updating goes very slow.
    I use the code below. I have a excel sheet with a range from A8:H282. When i use the update button it takes about 2 second before the new value has been listed and updated.

    The other thing is that when the listbox has been loaded the scrollbox is very very long. So it displays the range but i can scroll a lot of white space after the listed range.

    Please Login or Register  to view this content.
    Update button

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Slow vba cell update with listbox.

    Does this speed things up any when populating the listbox?
    Please Login or Register  to view this content.
    It's not clear, to me anyway, what exactly you are updating but it only looks like it's a few cells so I don't know why it's taking 2 seconds.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    10-19-2012
    Location
    Assen
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Slow vba cell update with listbox.

    Quote Originally Posted by Norie View Post
    Does this speed things up any when populating the listbox?
    Please Login or Register  to view this content.
    It's not clear, to me anyway, what exactly you are updating but it only looks like it's a few cells so I don't know why it's taking 2 seconds.
    No effect, i think it had to do with the update box. I only update one row with a length of 5 columns a time.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Slow vba cell update with listbox.

    I ran your code and it did take quite a bit for the listbox to be populated.

    With the code I posted there was no wait at all, it happened straight away.

    The code I posted isn't anything to do with updating, it's for the initial population of the listbox.

    Perhaps you could upload a sample workbook.

  5. #5
    Registered User
    Join Date
    10-19-2012
    Location
    Assen
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Slow vba cell update with listbox.

    Quote Originally Posted by Norie View Post
    I ran your code and it did take quite a bit for the listbox to be populated.

    With the code I posted there was no wait at all, it happened straight away.

    The code I posted isn't anything to do with updating, it's for the initial population of the listbox.

    Perhaps you could upload a sample workbook.
    Thanks for the reply. I will upload the sheet after my sleep maybe it has to do with the fact that my cells have cell property's. Eg % etc. That's why I used my code. But I will post.my sheet ASAP.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Slow vba cell update with listbox.

    The reason for your code being slow is probably just because of the loop which is going through 2000+ cells.

    Unfortunately it looks like you might need the loop if you want to keep the formatting.

+ Reply to Thread

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