+ Reply to Thread
Results 1 to 5 of 5

Why is my macro slow only some of the time?

  1. #1
    Registered User
    Join Date
    12-17-2010
    Location
    philadelphia, PA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Why is my macro slow only some of the time?

    I have a very simple copy and paste macro that reorganizes the cells into the correct positions. I have 3 different excel 2003 workbooks that I am using this on. Same code for each. On one of the workbooks, it had 1200 rows. That took 3min to finish. Another workbook with 7000 rows took 6min. now the last workbook with 22000 rows is gonna take like 6 hours. Its incredibly slower. But this same probably also happened with the first 2 workbooks the first few times I ran the macro on them. I can't figure out why sometimes they are working...any ideas?

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Why is my macro slow only some of the time?

    Hard to say for sure without the code, but are you turning off calculation, screenupdating and events at the start of your code and then turning them back on again afterwards?
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    12-18-2010
    Location
    UK
    MS-Off Ver
    2003, 2007, 2010
    Posts
    79

    Re: Why is my macro slow only some of the time?

    Your choice of computer and the other programmes you may be running on it at the same time as Excel will affect the processing time.

    If you have automatic back-ups switched on and Windows is going about its business, then that is going to be a contributing factor. Or an anti-virus sweep. Or an automatic back-up to the cloud.

    Please excuse me if I am suggesting the obvious.
    David
    Access and Excel Developer | UK

  4. #4
    Registered User
    Join Date
    12-17-2010
    Location
    philadelphia, PA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Why is my macro slow only some of the time?

    yea romperstomper I have all of that in the code and it doesnt help at all. And on the computer I am running the macro, excel is the only program I have running. Now we are on a business network here so I am not sure what they have running in the background on these computers. It is just weird that for 2 of the 3 workbooks it runs extremely fast and the third it doesnt. yet its the exact same code and setup just more rows...

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Why is my macro slow only some of the time?

    I find it extremely unlikely that that does not help at all! Have you tried it without those in there?
    Anyway, as I said, I can't really comment without seeing the code.

+ 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