Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default custom functions

Hi,

In VBA, when I define a user function and use it in the spreadsheet, it
does not seem to update. You have to manually go into the cell and re-input
the function name to get it to update when data has changed. Can you let it
auto-update as if it was a built-in Excel function?

Thanks,

Roel


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default custom functions

Roel wrote:

Hi,

In VBA, when I define a user function and use it in the spreadsheet, it
does not seem to update. You have to manually go into the cell and re-input
the function name to get it to update when data has changed. Can you let it
auto-update as if it was a built-in Excel function?


Add "Application.Volatile = True" in the code for your UDF.

Regards,
--
Beto
Reply: Erase between the dot (inclusive) and the @.
Responder: Borra la frase obvia y el punto previo.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default custom functions

Hi Roel,

Probably you did not include all the arguments in the argument list of the
function definition.
If you access cells directly from within a function, not via the argument
list, Excel does not know, so it doesn't know when to recalculate.
Including "Application.Volatile" may seem to help, but there are no
guarantees that cells will be recalculated in the correct order. Even if
they seem to do so, that is no guarantee for future releases of Excel.
The only correct way is to include all input to the function in the argument
list.

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"Roel" wrote in message
...
Hi,

In VBA, when I define a user function and use it in the spreadsheet,

it
does not seem to update. You have to manually go into the cell and

re-input
the function name to get it to update when data has changed. Can you let

it
auto-update as if it was a built-in Excel function?

Thanks,

Roel




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
Custom functions GKW in GA Excel Discussion (Misc queries) 3 February 20th 08 02:16 PM
Custom Functions DTTODGG Excel Worksheet Functions 7 January 11th 08 07:37 PM
Custom Functions Sloth Excel Discussion (Misc queries) 5 July 25th 06 04:59 PM
Using custom functions within custom validation Neil Excel Discussion (Misc queries) 4 December 14th 05 10:40 PM
Custom Functions scott Excel Worksheet Functions 2 December 28th 04 12:23 AM


All times are GMT +1. The time now is 08:06 PM.

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"