A function declaration begins with the keyword Function, followed by the function name. A parameter list contains the name and data type of variables to be passed into the function. A function returns a value; the keyword As precedes the data type of the returned value. The Return keyword is used to specify the value to be returned by the function. The function is terminated with the keywords End Function

Alternatively, the return value could be specified by setting the function to the value of the last executed statement:
