+ Reply to Thread
Results 1 to 6 of 6

efficiency recomendations, code taking long time to execute...

  1. #1
    Registered User
    Join Date
    06-04-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    36

    Smile efficiency recomendations, code taking long time to execute...

    Hi There, I am new to VBA and am looking for some pointers to make my code more efficient.

    I have a workbook containing 12 sheets to be fed data from a pivot table in another workbook. right now it is running only one and taking a long time...6 seconds. I fear that once all 12 sheets are populating their respective data the macro will run for 72 seconds.

    Can anyone spot beginner mistakes with my code. Again I would like to emphasize I am not looking for someone to clean it up or re-post my code using 10 lines, I am more looking for areas to "re-learn", possibly some alternatives to .Select, and .Activate? Am i on the right path with this code?

    ps. I left out the web address and file paths for obvious reasons...

    Thanks in advance!

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    06-04-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: efficiency recomendations, code taking long time to execute...

    After adding a couple more Web queries and running the macro it is taking significantly longer...again, I am requesting just some quick suggestions, I feel a little stuck.
    Thanks,

  3. #3
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: efficiency recomendations, code taking long time to execute...

    do you know exactly which part of code is running "slow"?....
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  4. #4
    Registered User
    Join Date
    06-04-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: efficiency recomendations, code taking long time to execute...

    How can I pin point that, comment blocks at a time and run? If I have to guess I would say it's most likely the Web query?

  5. #5
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: efficiency recomendations, code taking long time to execute...

    try something like this....

    Please Login or Register  to view this content.
    place a few of those in your code and then you can start narrowing where things take a long time....

  6. #6
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: efficiency recomendations, code taking long time to execute...

    this code might be a bit easier....

    Please Login or Register  to view this content.

+ 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