View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default how to update data displayed from a UDF when the source data chang

JMC

I don't seem to have a problem with this UDF not updating.

Is yours similar?

Function PrevSheet(rg As Range)
Application.Volatile
n = Application.Caller.Parent.Index
If n = 1 Then
PrevSheet = CVErr(xlErrRef)
ElseIf TypeName(Sheets(n - 1)) = "Chart" Then
PrevSheet = CVErr(xlErrNA)
Else
PrevSheet = Sheets(n - 1).Range(rg.Address).Value
End If
End Function


Gord Dibben MS Excel MVP

On Tue, 5 Sep 2006 14:49:01 -0700, JMC wrote:

I have a workbook that I am trying to use a user defined function to always
reference the previous sheet so I can make several copies of the sheet to
cover a 52 week period. I have made it this far. However when I change the
data and then go to the next sheet the calculations do not automatically
update. I have tried to refresh the data and re-calculate the sheet but the
calculation does not update. Any help would be appreciated.