Did you put the code in a standard code module of the same workbook.
--
HTH
Bob Phillips
"Mark Dvorkin" <[email protected]> wrote in message
news:[email protected]...
>
> 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
>
Bookmarks