I have a function that I implemented as a VBA module that takes a single cell as a parameter and requests web services to return the result. Since the data source is deleted, this function may take several seconds.
The problem is that some actions, such as deleting any column, seem to cause recalculation of each formula, even if no changes are required. When my sheet has several hundred rows, it may take several minutes for Excel to not respond.
I would like to find a way to find that no changes are required and skip this step. Some things I tried:
- Determine the current value of the cell you want to change, from which I can determine if an update is required. But ActiveCell.Value is empty, and attempts to pass this cell as the second parameter are met with a cyclic reference warning.
- Created a second column to store the old input value, which is then passed to the function and compared with the new value. However, functions cannot update this old value upon successful execution, and attempts to update only with formulas are always satisfied with cyclic help warnings. In addition, it does not seem that the function can return βno changeβ, so I will need to save and use the old result.
Is there a way to prevent some steps from updating each formula in a worksheet?
Other requirements:
- There may be a way to turn off automatic formula calculation, but I definitely want each line to be updated as soon as the parameter cell is entered. I also do not want to force the user to click a button to update the function.
- I tried to make a custom spreadsheet in Visual Studio, but found that deployment is too difficult to support for my user base. The solution should be fully contained in a macro-enabled book.
- The Excel version for using the worksheet will be in 2007 and 2010.
source share