Update value. Function

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

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
 
Hi Miguel

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

Application.Volatile

Regards,
Per
 
Hi Miguel

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

Application.Volatile

Regards,
Per

Thanks,

It worked just fine.

Thank You,
Miguel
 
Back
Top