+ Reply to Thread
Results 1 to 9 of 9

Is application.worksheet function faster than inputting formula directly into a cell??

  1. #1
    Registered User
    Join Date
    06-04-2019
    Location
    U.S.
    MS-Off Ver
    2016
    Posts
    48

    Is application.worksheet function faster than inputting formula directly into a cell??

    Good morning all!! Just had a quick question for you guys. Which method will run faster??

    1. Inputting a formula directly into a cell via vba. (i.e. Range("A1").Value = "INDEX(blah blah)")

    or

    2. Using Application.WorksheetFunction.Index(blah blah)

    I am trying to speed up some automation for my company, and just wondering which method would help it go faster as there are many lookups that I need to run in order to get all the information and am trying to keep it as quick and efficient as possible. Thank you!!

    Dome
    Last edited by BrokenDome; 06-14-2019 at 09:07 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Which is faster??

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Which is faster??

    The second option will put a value in the cell and will never be recalculated. The first puts a formula in the cell which may be recalculated. If the value is static and the formula does not need to be recalculated, then go for option 2.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Is application.worksheet function faster than inputting formula directly into a cell??

    Oops, sorry Alan. Typing while you were moderating

  5. #5
    Registered User
    Join Date
    06-04-2019
    Location
    U.S.
    MS-Off Ver
    2016
    Posts
    48

    Re: Is application.worksheet function faster than inputting formula directly into a cell??

    Mr. TMS,

    Good morning sir, and thank you for your response!! The formula does not need to be recalculated so no worries there. How much faster is using the Application.WorkSheetFunction?? Will the difference in speed be noticeable??

    Dome

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Is application.worksheet function faster than inputting formula directly into a cell??

    If it's a one off, say as part of a Worksheet Change Event handler, I’d go with the second option.

    If it's necessary to fill down, I’d drop the formula into the entire range. If it may be recalculated, I’d leave the formulae there, otherwise I’d convert it to values.

    I can't really comment on which is faster as a one off but I’d guess it would be option 2.

  7. #7
    Registered User
    Join Date
    06-04-2019
    Location
    U.S.
    MS-Off Ver
    2016
    Posts
    48

    Re: Is application.worksheet function faster than inputting formula directly into a cell??

    Mr. TMS,

    Thank you again for the quick reply!! I use a loop to go through all cells inputting the formula based on which information I need to pull. Each month, the information changes, and all the information must be pulled again. Since rows change, I am unable to leave the information and just recalculate, I have to re-pull information each time the macro is run. One last question, how would I need to change the following in order to use the worksheet functions??

    EndDate is a value input by a user
    I is a counter used in a loop

    This one just gives me the match data in column AY

    Please Login or Register  to view this content.
    This one uses the match data from the first one to find corresponding data

    Please Login or Register  to view this content.
    Thank you!!

    Dome

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Is application.worksheet function faster than inputting formula directly into a cell??

    How do you determine the last value for i?

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Is application.worksheet function faster than inputting formula directly into a cell??

    Some ideas to play with:

    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)

Similar Threads

  1. Faster way to categorize data (Faster than nested-if)
    By excel1985 in forum Excel General
    Replies: 6
    Last Post: 03-05-2014, 07:00 AM
  2. Faster way to categorize data (Faster than nested-if)
    By excel1985 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-05-2014, 01:56 AM
  3. Is there a faster way?
    By jamesstorx in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2010, 05:45 PM
  4. Which one is faster and better
    By Shailee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-28-2010, 05:41 AM
  5. faster
    By always in forum Excel General
    Replies: 1
    Last Post: 10-26-2007, 02:43 AM
  6. [SOLVED] needs to run faster
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-02-2005, 05:20 PM
  7. Faster way to do this?
    By Ed in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-14-2005, 04:10 PM
  8. [SOLVED] Can faster CPU+larger/faster RAM significantly speed up recalulati
    By jmk_li in forum Excel General
    Replies: 2
    Last Post: 09-28-2005, 06:05 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