Not sure what you mean by 'to an add-in'
Where did you actually place the code? If it is Book1 then to use it in
Book2 you need Book1 open and refer to =Book1.xls!markup(a,b,c)
Why not save the macro in Personal.XLS. This file is saved in XLSTART
folder; it automatically opens when Excel starts but is hidden. Then you use
=Personal.XLS!markup(a,b,c)
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email
"Samad" wrote in message
...
I put some vb code to a add-ins file that create markup i.e
Function markup(principal, rate, days)
markup = principal * rate / 365 * days
End Function
it works fine in new sheets but whenever I try to replace the formulas in
existing sheets it display #name? error.
can someone help me what I'm doing wrong or is it a formatting problem
Thanks in advance