+ Reply to Thread
Results 1 to 5 of 5

Macro taking too long to execute

  1. #1
    Forum Contributor
    Join Date
    10-16-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2003, 2010
    Posts
    151

    Macro taking too long to execute

    Greetings all

    I have been working on a macro this week that will insert a row underneath the header and write the formulas to the proper cells so that we can record production in a reasonably efficient manner. I do not claim to be a macro magician and I am sure there are better ways to accomplish some of the things I am doing, but it seem as though this particular macro has taken it upon itself to run too slow to be useful at all. The entire macro, comments and all is only 266 lines long (and there are a lot of comments as I wanted someone else to be able to go in a tell what was going on). It seemed to be working fine yesterday and I have been putting the final formulas in today before working on the formatting. When I tested it before lunch, it froze, so after lunch I ran it in debug mode and it isn't hanging on the back end where I have been working today, but at the very beginning. Can someone please take a look at this and see if there is something I am missing that would cause it to hang up?

    Please Login or Register  to view this content.
    Right now, I have data going out to column BP and a little over 3,100 rows

    I would appreciate it if anyone could see what I am doing that would cause this thing to hang up like it is.

    Thanks
    Jacob Albers
    Excel 2003 & 2010

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro taking too long to execute

    Try to insert the following lines on your macro to suppress screen updating and display alter.

    Application.screenupdating= 0
    Application.displayalerts= 0

    Application.screenupdating= 1
    Application.displayalerts= 1

  3. #3
    Forum Contributor
    Join Date
    10-16-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2003, 2010
    Posts
    151

    Re: Macro taking too long to execute

    Thanks for your response!

    I tried it, but without any success. It still took about 4 minutes to execute the macro. One thing I noticed while watching the screen not do anything, was that the program would alternate between being responsive and not responsive. I wasn't trying to do anything else at the time, just watching. I took out the screenupdating statements and tried again and it still alternated between responsive and non responsive.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro taking too long to execute

    I think the cuplrit lines are these
    Range("6:6")
    Rows("6")
    what are these lines? You also have to open your folder and that takes another 30 seconds. This is really weird

  5. #5
    Forum Contributor
    Join Date
    10-16-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2003, 2010
    Posts
    151

    Re: Macro taking too long to execute

    When I insert the row

    Please Login or Register  to view this content.
    Actually, the file Product Data is almost always already open, so it seldom has to actually open it. It isn't making any sense to me either.

+ 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