+ Reply to Thread
Results 1 to 6 of 6

Help Rewriting VBA Function

  1. #1
    Registered User
    Join Date
    03-28-2015
    Location
    us
    MS-Off Ver
    Office365
    Posts
    46

    Help Rewriting VBA Function

    I was wonder if someone could help me rewrite this VBA function to remove the application Volatile?

    Please Login or Register  to view this content.
    Thank You

    Josh

  2. #2
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: Help Rewriting VBA Function

    Can I ask what problem you're trying to solve?

    Application.volatile marks a function to recalculate whenever any cell changes. If we remove that, your function is going to need another calling method. Why do you want to turn off automatic running and what would you like to trigger it instead?

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,869

    Re: Help Rewriting VBA Function

    I simply removed the Application.Volatile statement, and it seemed to work just fine as a non-volatile function. It was called when inputs to the function were changed and ignored changes made to other cells in the spreadsheet. Why do you think it needs the Application.Volatile statement, or needs a significant re-write to remove the volatile statement?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: Help Rewriting VBA Function

    It doesn't. I was wondering why you'd used it in the first place.

  5. #5
    Registered User
    Join Date
    03-28-2015
    Location
    us
    MS-Off Ver
    Office365
    Posts
    46

    Re: Help Rewriting VBA Function

    Quote Originally Posted by BellyGas View Post
    Can I ask what problem you're trying to solve?

    Application.volatile marks a function to recalculate whenever any cell changes. If we remove that, your function is going to need another calling method. Why do you want to turn off automatic running and what would you like to trigger it instead?
    The reason I am trying to remove it is because any changes to the Spreadsheet data on any cell (not necessarily the cell the function is in) it recalculates every mention of that function and is slowing my spreadsheet down when a lot of data is being input.

    The reason Application.volatile is needed is because I need it to recalculate until it finds an empty cell.

    I am using the function like this: =My_Text_Join("",1, Formulas!S:S)

    Maybe I don't even need this function and there is another way to join the text together of S:S (not including blank cells)?

  6. #6
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Help Rewriting VBA Function

    I am not surprise that it slowing down, if you checking full column S.
    Is that necessary? VBA is checking over million cells, are they empty or not?

    EDIT:
    If you are not sure how many rows do you need in column, I've tweak a bit your VBA function to find out last row in col. S.
    Try like this, maybe it helps:

    Please Login or Register  to view this content.
    should works.
    Last edited by KOKOSEK; 04-12-2019 at 07:55 AM.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

+ 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] rewriting formula to eliminate "offset" function
    By jrtaylor in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-03-2016, 03:34 PM
  2. Help Rewriting With Loops
    By naturaldissolve in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-10-2016, 03:50 AM
  3. Need help rewriting existing formulas please
    By [email protected] in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-01-2016, 04:43 PM
  4. Help rewriting code to use less memory
    By Karl Gustaf Karsten in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-23-2016, 12:56 PM
  5. Rewriting the AND expression
    By lazyme in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-15-2007, 06:43 PM
  6. [SOLVED] Rewriting equation for VB
    By Barb Reinhardt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2006, 03:35 PM
  7. Rewriting a formula...
    By Roz in forum Excel General
    Replies: 3
    Last Post: 01-06-2006, 12:15 PM

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