+ Reply to Thread
Results 1 to 8 of 8

Speed up code that inputs formulas

  1. #1
    Registered User
    Join Date
    04-16-2014
    Location
    London
    MS-Off Ver
    Office365
    Posts
    4

    Speed up code that inputs formulas

    Hi,

    This is the first time I've joined and posted to a forum, I usually search and find the answers through Google. However, I'm at a point where I cannot work out how to improve my code. This code works, its just too slow.

    The code offsets down rows(approx 7000) inputting formulas as it goes, it then calculates and sets back to values. I've done some simple test by removing parts of the code, and I have identified it is the inputting of the formulas which takes about a minute to run.

    Any ideas/replacement code to make this faster will be greatly appreciated.


    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644
    What are the formulas?
    If posting code please use code tags, see here.

  3. #3
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Speed up code that inputs formulas

    try setting calculation to manual, then back

    application.calculation=xlManual


    code

    application.calculation=xlAutomatic
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  4. #4
    Registered User
    Join Date
    04-16-2014
    Location
    London
    MS-Off Ver
    Office365
    Posts
    4

    Re: Speed up code that inputs formulas

    Hi, the calculations are already set to manual.

    Here are my Public Declerations:
    Please Login or Register  to view this content.
    Here are the formula's:
    Please Login or Register  to view this content.
    Would it be quicker to store these in an array?

    Or is it the offset code which is slowing

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

    Re: Speed up code that inputs formulas

    I was actually hoping to see if it might be possible to insert the formulas without looping.

    Looking at the formulas and the offsets in the code I don't think that's going to be possible, perhaps if you upload an example workbook I could check that out further.

    In the meantime this might speed things up a little.
    Please Login or Register  to view this content.
    Last edited by Norie; 05-29-2014 at 10:51 AM.

  6. #6
    Registered User
    Join Date
    04-16-2014
    Location
    London
    MS-Off Ver
    Office365
    Posts
    4

    Re: Speed up code that inputs formulas

    Hi Norie,

    Thanks for the reply, this did speed up a bit.

    I finally found out that it was clashing conditional formatting (and probably too much) that was causing it go very slowly.

    Your help was much appreciated!

  7. #7
    Registered User
    Join Date
    04-16-2014
    Location
    London
    MS-Off Ver
    Office365
    Posts
    4

    Re: Speed up code that inputs formulas

    Also, how do I set this thread to solved?

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

    Re: Speed up code that inputs formulas

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Inputs to trigger VBA code
    By kal46 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-28-2016, 02:23 PM
  2. [SOLVED] Code to speed up sumproduct formulas
    By tbeast in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-27-2012, 05:14 PM
  3. How to Speed Up the File Processing i.e Formulas Vs VBA ?
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 31
    Last Post: 10-22-2011, 12:33 PM
  4. Named formulas (arrays) and speed
    By mattflow in forum Excel General
    Replies: 2
    Last Post: 09-16-2010, 11:52 AM
  5. Speed up a 100k AverageIf formulas
    By Coaster in forum Excel General
    Replies: 5
    Last Post: 08-04-2010, 02:09 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