View Single Post
  #2   Report Post  
Vacation's Over
 
Posts: n/a
Default custom function not recalcing on sheet with outline view

add to function

application.screenupdating = false
'''ungroup everything
'''Your function code here
Application.calculate
''regroup everthing
application.screenuopdating = true


"donh" wrote:

Very strange: Have a user-written function used hundreds of times on one
sheet. Often, when the workbook is first opened, all of those function
references show as blank. Hitting F9 (recalc) has no effect; in fact the
only way I can get the functions to calculate is by expanding or compressing
one of the outline view ("grouping") areas on the sheet. At that point, all
the cells with the function in it recalc immediately and have the proper
values.

The functions in question are not within the outline area being changed. It
appears that if I remove all the grouping from the sheet, I can't get this
behavior. But I want the grouping there to help hide some parts of the sheet.

The function is a simple one, doing something similar to a VLOOKUP. It
follows the rules about all cells or ranges being referenced coming in
through the parameter list, so the calculation engine knows about precedents.

Does anyone know what might be causing this bizzarre behavior? I've not
found anything in the MS Knowledgebase or other web searches. Thanks in
advance.
--
Don H.