You declare it as a Public Function. Instead of having it in a Sub, you would have it in a Public Function.
for example, put this in a standard module:
<pre>
Public Function MySum(TgtRange As Range) As Long
Dim Rng As Range
Dim TempAns As Long
For Each Rng In TgtRange
TempAns = TempAns + Rng.Value
Next
MySum = TempAns
End Function
</pre>
To use this function simply type in "=MySum(XX:XX)", where "XX:XX" is the range that you'd like to get the sum of.
HTH