+ Reply to Thread
Results 1 to 3 of 3

Fastest Loop Code?

Hybrid View

  1. #1
    Registered User
    Join Date
    08-07-2006
    Posts
    31

    Fastest Loop Code?

    Greetings

    Quick question.

    Which code runs quickest when looping through a large number of rows to perform calculations, for example?

    For ... Next, Do ... Loop etc

    Chard

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    It al depends on how you are using the loops and the structure of your commands.


    For Next loops have a counter built in as part of the For command which makes it easy & quicker to use inside the loop as row counters

    With Do Loops you need to add in your own method of tracking the rows.

    If you are stepping through rows until a certain condition is met the Do loops could be faster as they can have the test component built in as part of the Do or Loop command & the For loops needs it added as seperate test condition commands
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Registered User
    Join Date
    08-07-2006
    Posts
    31
    Thanks mate!

+ 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