+ Reply to Thread
Results 1 to 2 of 2

Performance issue - Looping through Cells

  1. #1
    Registered User
    Join Date
    09-12-2011
    Location
    San Diego ,CA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Performance issue - Looping through Cells

    I have a failry complex application that involves data transfer between two separate WorkBooks.

    The application works perfectly however, I do have a performance issue that I am hoping to solve. I did extensive debugging and tracing to isolate the portion of the code that was bogging down. I then read extensively on the symtpoms and learned that the cause was likely do to the "For Each ... Next" construct I was using to loop through the cells.

    Please Login or Register  to view this content.

    One possible solution I located involved a method whereby the Range "value" is first copied to an array, processed quickly, then copied back to the range. I wasn't able to figure out how to implement that method with the "numberformat" property though which is necessary in my logic above. In case it helps, here is the "copy to an array" method which runs exceedingly fast:

    Please Login or Register  to view this content.

    Thank you for anything you can offer.

    Doug

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Performance issue - Looping through Cells

    Hi Doug

    It's a bit difficult without seeing the data but, in reading your code, have you considered filtering the data and making changes to the visible cells?

    If you'll post a sample of the data (before and after) I MAY be able to help.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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