Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Jim is offline
external usenet poster
 
Posts: 615
Default Stopping User Defined Functions for Recalculating

I have a user defined function that performs a calculation on a range of
cells. If a row or column outside of the range used by the function is
deleted the function automatically recalculates. How do I stop the function
from recalculating? I have tried using the Application.Volatile (False)
statement but the function still will recalculate whenever a row or column is
deleted. I only want the function to recalculate when the one of the cells
it is referencing changes.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Stopping User Defined Functions for Recalculating

Maybe you can adapt this worksheet change event (placed in the relevant
worksheet code). In this case the function would only be called if cell A1
(row1 / column 1) where to change.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 1 And Target.Column = 1 Then
Call yourfunction
End If
End Sub

--
Cheers
Nigel



"Jim" wrote in message
...
I have a user defined function that performs a calculation on a range of
cells. If a row or column outside of the range used by the function is
deleted the function automatically recalculates. How do I stop the

function
from recalculating? I have tried using the Application.Volatile (False)
statement but the function still will recalculate whenever a row or column

is
deleted. I only want the function to recalculate when the one of the

cells
it is referencing changes.



  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Jim is offline
external usenet poster
 
Posts: 615
Default Stopping User Defined Functions for Recalculating

Thanks but this will not work for me. The UDF is part of an add-in. Also I
need the function to update any cells the function refers to changes.

"Nigel" wrote:

Maybe you can adapt this worksheet change event (placed in the relevant
worksheet code). In this case the function would only be called if cell A1
(row1 / column 1) where to change.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 1 And Target.Column = 1 Then
Call yourfunction
End If
End Sub

--
Cheers
Nigel



"Jim" wrote in message
...
I have a user defined function that performs a calculation on a range of
cells. If a row or column outside of the range used by the function is
deleted the function automatically recalculates. How do I stop the

function
from recalculating? I have tried using the Application.Volatile (False)
statement but the function still will recalculate whenever a row or column

is
deleted. I only want the function to recalculate when the one of the

cells
it is referencing changes.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Stopping User Defined Functions for Recalculating

On Wed, 1 Jun 2005 16:54:03 -0700, Jim
wrote in microsoft.public.excel.programming:

I have a user defined function that performs a calculation on a range of
cells. If a row or column outside of the range used by the function is
deleted the function automatically recalculates. How do I stop the function
from recalculating? I have tried using the Application.Volatile (False)
statement but the function still will recalculate whenever a row or column is
deleted. I only want the function to recalculate when the one of the cells
it is referencing changes.


Set Tools/Options.../Calculation to Manual; then calculate with F9 on
demand.

On Fri, 3 Jun 2005 18:54:02 -0700, Jim
wrote in microsoft.public.excel.programming:

Thanks but this will not work for me. The UDF is part of an add-in.


Eh? So where did you put the .Volatile statement? It has to be within
the UDF in question, not just anywhere.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Jim is offline
external usenet poster
 
Posts: 615
Default Stopping User Defined Functions for Recalculating

I did placed the application.volatile statement within the UDF. I have it as
the first statement in the UDF.



Eh? So where did you put the .Volatile statement? It has to be within
the UDF in question, not just anywhere.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Defined Functions MoTrekker Excel Discussion (Misc queries) 2 November 8th 09 06:36 PM
User Defined Functions - Help Text - Make it Easy for the User Andibevan[_2_] Excel Programming 4 March 17th 05 09:51 AM
User defined functions big t Excel Programming 3 September 29th 04 11:40 AM
excel functions and User defined functions Kanan Excel Programming 4 May 20th 04 11:21 PM
User Defined Functions KMcNelson Excel Programming 4 February 23rd 04 09:09 PM


All times are GMT +1. The time now is 03:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"