A subroutine and a function are practically the same thing. The only
difference is that a function returns something.
Example:
Public Sub AddNumbersSubroutine(x as integer, y as integer)
Debug.WriteLine(x + y)
End Sub
Public Function AddNumbersFunction(x as integer, y as integer) as integer
Return x + y
End Function
Then, in another part of your program, you can either say:
Call AddNumbersSubroutine(10, 32)
Or, you can say:
Dim myValue as Integer
myValue = AddNumbersFunction(10, 32)
Hope this helps.
-Jason