The Sub statement is used to execute one or more lines of code.
The Function statement is used to execute one or more lines of code AND return a value to the caller.
Use a Sub when you do not need to return a value to the calling code. Use a Function when you need to return a value.
More about subs
•http://msdn.microsoft.com/en-us/library/dz1z94ha.aspx
More about functions
•http://msdn.microsoft.com/en-us/library/sect4ck6.aspx