Procedure and Subprocedure

First, though, let's get some terminology straight. "Procedure" is a generic term that can be used to describe either a function or a sub function. I touched some of this confusing terminology earlier, but a function is a procedure that returns a value. Trim ( ) is a function. You pass it some text, and it returns the same text back to you, but with the leading trailing spaces stripped off. Functions do not always require input, but they often do.

A sub procedure is a procedure that does not return a value. We have been using MsgBox ( ) as a sub procedure in other posts. We pass it some text, and it displays a message on the screen. It does not return any kind of value to our code. All we need to know is that it did what we asked it to do. Like functions, procedure may or may not require input.