+ Reply to Thread
Results 1 to 9 of 9

Speed Up Loop in VBA

  1. #1
    Forum Contributor PY_'s Avatar
    Join Date
    09-23-2008
    Location
    Houston
    MS-Off Ver
    Office 2016
    Posts
    289

    Speed Up Loop in VBA

    All,

    Is there a faster way to perform the following two loops?

    Please Login or Register  to view this content.
    Last edited by PY_; 07-19-2013 at 08:57 AM.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Speed Up Loop in VBA

    perhaps
    Please Login or Register  to view this content.
    have you already turned off screenupdating?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Contributor PY_'s Avatar
    Join Date
    09-23-2008
    Location
    Houston
    MS-Off Ver
    Office 2016
    Posts
    289

    Re: Speed Up Loop in VBA

    Sorry, yes screen updating is off and so are events.

  4. #4
    Forum Contributor PY_'s Avatar
    Join Date
    09-23-2008
    Location
    Houston
    MS-Off Ver
    Office 2016
    Posts
    289

    Re: Speed Up Loop in VBA

    From what i can tell, you are combining the two loops into one and it only performs one thing else another thing. I need it to perform both loops separately because the second one depends on the first loop's changes.

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Speed Up Loop in VBA

    Quote Originally Posted by PY_ View Post
    the second one depends on the first loop's changes.
    in what way?

  6. #6
    Forum Contributor PY_'s Avatar
    Join Date
    09-23-2008
    Location
    Houston
    MS-Off Ver
    Office 2016
    Posts
    289

    Re: Speed Up Loop in VBA

    Good question...haha

    For some reason, i had it in my head they were dependent on each other. I guess because the way i did it in my head is the way i did it in code and never looked back. I ran it your way and it did seem to cut the time in half.

  7. #7
    Forum Contributor PY_'s Avatar
    Join Date
    09-23-2008
    Location
    Houston
    MS-Off Ver
    Office 2016
    Posts
    289

    Re: Speed Up Loop in VBA

    If i can do this without violating forum rules, i have a second set of loops that also need another eye to look at. I either run the above loop or the below loop depending on the import i am performing. (Last loop i promise)


    Please Login or Register  to view this content.

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Speed Up Loop in VBA

    perhaps
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor PY_'s Avatar
    Join Date
    09-23-2008
    Location
    Houston
    MS-Off Ver
    Office 2016
    Posts
    289

    Re: Speed Up Loop in VBA

    That worked as well. It was missing some data when it went from 100 to 1 so i set it back to 1 to 100 and that did the trick.


    Thank you JosephP, that did cut down the runtime some and every second i can shave off definitely helps!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Help Speed up this Loop?!?
    By arleutwyler in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-06-2013, 01:49 AM
  2. Speed up a VLookUp loop
    By wizuriel in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-11-2013, 07:28 PM
  3. Loop alternatives or improvement for speed
    By TommyN in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2013, 06:00 PM
  4. Speed Up VBA Loop Code
    By rlsublime in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 12-30-2012, 07:20 PM
  5. Trying to speed up the calculation my For Loop
    By Astroboy142 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2010, 04:32 AM

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