Originally posted by ZeppHead80
What that means for this is that VBA allows both types of procedure to be called as both types. A sub procedure should really be called similarly to a simple statement. In that version no parentheses are used and the parameters are supplied as a list after the name of the procedure call. A Function procedure, on the other hand, should be called in code that processes the return value - typically, but not limited to, assigning the value to a variable. When a function procedure is used in this way the parameters that follow the procedure call are enclosed in parentheses.
To allow function calls to avoid using or saving their returned values there is a Call statement. This really just says - Run the Function procedure but just drop the returned result. In this situation the procedure is treated as a function and the parameters are enclosed in parentheses. Sub procedures can also be used with the Call statement, and their parameters are handled the same way.
What all this boils down to is that the parentheses are not assoiciated with any particular procedure, but rather with how they are referenced in the code.
Comment