Calling A Custom Funttion

Calling A Custom Funttion

I want to run a custom function based on a user wanting to run the function not based on a workflow rule.  i.e. When they press a custom button or run a macro.

I can't see anything to do this? Any ideas?