Ok i figured out how, i don't have the code on me now but i will post it later so other people can see how. Thanks for all the help.
Public Function "Name"()
Then you just call the code up with:
<EDIT> Do not use any of the quotes, just there to show where to put the name of the function.