Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Update value. Function

Hello,

I created a simple function on VBA as follows:

Function Test() As Integer
Dim I As Single
For I = 17 To 24
Test = (Test + 1) * Range("Examples_1_a_4!B" & I)
Next I
End Function

On my Excel sheet I have on a cell the following:
=Test()

It works but when I change a value in the range I need to go to the
result cell and click enter to the value be updated.

Why?

Thanks,
Miguel
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Update value. Function

Hi Miguel

You have to make you funciton volatile, to do so, add this as first line in
you sub:

Application.Volatile

Regards,
Per

"shapper" skrev i meddelelsen
...
Hello,

I created a simple function on VBA as follows:

Function Test() As Integer
Dim I As Single
For I = 17 To 24
Test = (Test + 1) * Range("Examples_1_a_4!B" & I)
Next I
End Function

On my Excel sheet I have on a cell the following:
=Test()

It works but when I change a value in the range I need to go to the
result cell and click enter to the value be updated.

Why?

Thanks,
Miguel


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Update value. Function

On Nov 20, 1:34*pm, "Per Jessen" wrote:
Hi Miguel

You have to make you funciton volatile, to do so, add this as first line in
you sub:

Application.Volatile

Regards,
Per

"shapper" skrev i ...

Hello,


I created a simple function on VBA as follows:


Function Test() As Integer
*Dim I As Single
*For I = 17 To 24
* *Test = (Test + 1) * Range("Examples_1_a_4!B" & I)
*Next I
End Function


On my Excel sheet I have on a cell the following:
=Test()


It works but when I change a value in the range I need to go to the
result cell and click enter to the value be updated.


Why?


Thanks,
Miguel




Thanks,

It worked just fine.

Thank You,
Miguel
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
now function not to update baha Excel Discussion (Misc queries) 5 September 25th 09 11:57 AM
now function not to update baha Excel Discussion (Misc queries) 0 September 25th 09 11:46 AM
03 to 07 function update Martin Wheer Excel Programming 2 June 9th 09 10:22 AM
Don't Update Function RedFive Excel Discussion (Misc queries) 1 September 23rd 08 02:38 PM
How to get function to update itself with changes richardbok Excel Programming 3 February 27th 04 02:26 AM


All times are GMT +1. The time now is 11:05 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"