VBA Passing Arguments ByRef or ByVal
Passing Simple Variables ByRef And ByVal
Passing ByRef or ByVal indicates whether the actual value of an argument is passed to the CalledProcedure by the CallingProcedure, or whether a reference (called a pointer in some other languages) is passed to the CalledProcedure.
If an argument is passed ByRef, the memory address of the argument is passed to the CalledProcedure and any modification to that parameter by the CalledProcedure is made to the value in the CallingProcedure.
If an argument is passed ByVal, the actual value, not a reference to the variable, is passed to the CalledProcedure.
A simple example will illustrate this clearly: