+ Reply to Thread
Results 1 to 7 of 7

Macro running too fast

  1. #1
    Registered User
    Join Date
    05-28-2014
    Posts
    67

    Macro running too fast

    What can you do to slow down a macro? I think my code is skipping some very crucial steps.

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,176

    Re: Macro running too fast

    1st: You can trace it by putting in a stop code (F9) on any line , then progress 1 step at a time(F8) to watch it.

    2: you can put in loops to slow it down
    for i = 1 to 5000
    next

    But I would trace it.

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

    Re: Macro running too fast

    That probably isn't happening, though it might appear to be.

    Try stepping through the code with F8 to see what's happening, take particular note if any areas are being skipped because of, say, an If statement.

    Also, try putting some breakpoints on, or before, the steps that you think are being skipped, you can do that with F9.

    When you next run the code execution will be interrupted wherever you've put a breakpoint, unless code is being skipped.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    05-28-2014
    Posts
    67

    Re: Macro running too fast

    I've traced it many times with F8. Everything works fine when I step into, but when I try to run the whole code, it looks like it's skipping steps.

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

    Re: Macro running too fast

    Did you try putting break points on the code you think is being skipped?

  6. #6
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,176

    Re: Macro running too fast

    It cant do it different when you watch it vs when you dont.

  7. #7
    Registered User
    Join Date
    05-28-2014
    Posts
    67

    Re: Macro running too fast

    Thank you! I will try again and see what happens.

+ 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] Fast macro to hide empty rows
    By Joak in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-22-2014, 05:04 PM
  2. Will Excel macro be fast enough for serial data reading in my project?
    By prm_ex in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-11-2013, 03:49 AM
  3. [SOLVED] Excel code running too fast?
    By etacv in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-20-2013, 01:14 PM
  4. Macro Runs Too Fast
    By LizS in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-23-2005, 10:20 AM
  5. Why macro slow on one, fast on another?
    By CLR in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-04-2005, 09:06 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