Collection of the common code is known as module, modules are separate files from projects and can be reused. There are basically like general section of a from, but in a different file. Such files can contain global variables and general procedures; however may not contain event procedures, as modules aren’t tied to any particular form.
Programmer may which to make a module that contains common functions. That is way to programmer writes the code once and can use it for any project to use any one of particular functions without writing the code again. Functions in the module are not object specific. This in the long run saves a lot of time. Below is an example of object-specific and non object-specific code:
Public Function Copy Text ()
Clipboard.SetText = frmMain.txtText.SetText
Non Object-Specific Code:
Public Function Copy Text (Text Source)
Clipboard.SetText = TextSource