View Single Post
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Did you put the code in a standard code module of the same workbook.

--
HTH

Bob Phillips

"Mark Dvorkin" wrote in message
...

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