#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default VBA Functions

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default VBA Functions

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

Application.Volatile

SheetIndex = rngSheet.Parent.Index
--
Kevin Backmann


"tplourde" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,290
Default VBA Functions

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"
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
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default VBA Functions

Outstanding,

Thankyou

"Kevin B" wrote:

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

Application.Volatile

SheetIndex = rngSheet.Parent.Index
--
Kevin Backmann


"tplourde" wrote:

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

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
Can I get Excel to determine the line curve formula without graph. Cadelima Excel Discussion (Misc queries) 8 December 20th 05 09:57 PM
User-defined functions created in Excel 2000 fail in Excel 2003 goodguy Excel Discussion (Misc queries) 1 October 3rd 05 07:04 PM
Database functions should use criteria in formula, as 1-2-3 does 123user Excel Worksheet Functions 8 September 29th 05 08:57 PM
Visible rows and functions that work tracy Excel Worksheet Functions 2 August 19th 05 05:25 AM
PASTE DOWN FUNCTIONS jackle Excel Worksheet Functions 0 May 25th 05 02:10 PM


All times are GMT +1. The time now is 12:24 PM.

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

About Us

"It's about Microsoft Excel"