calculation control

I wrote, the function I copy at the end of this mail but it works correctly only when I put a Return in each place were it is used in the spreadsheet but not automatically, it also do not work when a change in a cell is made.

Can you give me an advise to modify it in the way it can make the calculations in all the spreadsheet when I modify a content of a cell

Will appreciate your help

Thanks

Jorge
jorge.ayllon@yahoo.es

Function RMES()
ce = ActiveCell.Column
ci = ce
re = ActiveCell.Row
ri = re
vce = Cells(re - 1, ce)
If vce = 0 Then RMES = 0: GoTo 100
de = Cells(re - 1, 2)
mo = Month(de)
While Month(Cells(ri - 1, 2)) = mo
ri = ri - 1
Wend
di = Cells(ri, 2)
vci = Cells(ri, ci)
n = de - di
RMES = ((vce / vci) ^ (30 / n) - 1) * 100
100
End Function