VBA Functions

T

tplourde

Why doesn't this function refresh. The only time it refreshes is when I
activate the cell, press F2 and Enter.

Function SheetIndex(rngSheet As Range) As Long
SheetIndex = rngSheet.Parent.Index
End Function
 
K

Kevin B

Modify your code by adding this line as the top of the function:

Application.Volatile

SheetIndex = rngSheet.Parent.Index
 
J

Jim Cone

It seems to work if you add this line to the code...
Application.Volatile

Ctrl + Alt + F9 also works.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"tplourde" <[email protected]>
wrote in message
Why doesn't this function refresh. The only time it refreshes is when I
activate the cell, press F2 and Enter.

Function SheetIndex(rngSheet As Range) As Long
SheetIndex = rngSheet.Parent.Index
End Function
 
T

tplourde

Outstanding,

Thankyou

Kevin B said:
Modify your code by adding this line as the top of the function:

Application.Volatile

SheetIndex = rngSheet.Parent.Index
 
Top