In Excel VBA, a function is similar to a procedure but the main purpose of the function is to accept a certain input from the user and return a value which is passed on to the main program to finish the execution. There are two types of functions, the built-in functions (or internal functions) and the functions created by the programmers, or simply called user-defined functions. We shall deal with built-in functions in this lesson and the user-defined functions in the next lesson.
The first built-in function that we have already learned and familiar with its usage is the Message Box. We are not going to repeat here but we shall take a look at its syntax once more, i.e.
message=MsgBox(Prompt, Style Value,Title)
Now we shall examine the next commonly used function in Excel VBA, it is none other than the InputBox function.
Read more about functions at: http://excelvbatutor.com/index.php/excel-vba-lesson-8/