View Single Post
  #1   Report Post  
Mark Dvorkin
 
Posts: n/a
Default calling a new function Excel gives me #NAME?


I wrote a simple function using VBA Editor.

Function prevDay(Ref)
Application.Volatile
prevDay = Sheets(Application.Caller.Parent.Index - 1).Range(Ref.Address)
End Function

When I call it Excel gives me #NAME? error.

Do I need to register it somehow?

sorry for a bloody beginner question
and thanks in advance for any help.

/mark