+ Reply to Thread
Results 1 to 5 of 5

My procedures take too long to run...

  1. #1
    Registered User
    Join Date
    10-30-2014
    Location
    Edinburgh, Scotland
    MS-Off Ver
    2007 Pro
    Posts
    27

    My procedures take too long to run...

    Hi,
    I have a couple of procedures that work, but they take a long time to run, and I was wondering if you can suggest ways to make them more efficient (which could be a complete change of approach)? The reason I ask is because I want to get better at writing efficient code. I've pretty much copied the code and adapted it so I'm sure it could be better. I'm happy to send out the workbook or provide further explanation if it would help.

    The first sub "copysheets()" brings worksheets in from another workbook based on a list of sheet names. The second sub populates the imported sheets with formulae.

    Here they are:

    Please Login or Register  to view this content.
    Thanks very much.

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

    Re: My procedures take too long to run...

    You could try the standard things like turning of screen updating, calculation and events.

    Please Login or Register  to view this content.
    Another thing that might help is getting rid of this in the first sub.
    Please Login or Register  to view this content.
    I don't really think you need to go back to the workbook the code is in, you already have the filenames for the files to open in the array.

    That should speed things up a bit, we'd probably need to see sample workbook(s) to tell if there's anything that could make a significant impact.

    PS You should probably be using FormulaR1C1 as all your formulas are in R1C1 notation, never kno that might speed things up a bit too.
    Last edited by Norie; 11-20-2014 at 10:26 AM.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    10-30-2014
    Location
    Edinburgh, Scotland
    MS-Off Ver
    2007 Pro
    Posts
    27

    Re: My procedures take too long to run...

    Thanks Norrie - I'd only switched off screen updating and missed the others. I'll give that a try.

  4. #4
    Registered User
    Join Date
    10-30-2014
    Location
    Edinburgh, Scotland
    MS-Off Ver
    2007 Pro
    Posts
    27

    Re: My procedures take too long to run...

    Sorry - I meant thanks Norie

  5. #5
    Registered User
    Join Date
    10-30-2014
    Location
    Edinburgh, Scotland
    MS-Off Ver
    2007 Pro
    Posts
    27

    Re: My procedures take too long to run...

    And then realised I could have just edited my reply...

+ 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] =IF and =SUMIF formulas creating long long long data processing times.
    By comp in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 03-26-2014, 02:59 PM
  2. Event Procedures
    By pflipper in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-30-2009, 01:42 PM
  3. VBA Sub Procedures
    By ladeda063610 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2008, 03:12 AM
  4. [SOLVED] Get VBA procedures from DB
    By Hiran de Silva in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2006, 12:50 PM
  5. [SOLVED] A question on procedures
    By Frederick Chow in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-22-2006, 06:10 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