Functions and Subs

Build 1501 on 14/Nov/2017  This topic last edited on: 25/Aug/2014, at 11:42

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