What Is The Difference Between Byval And Byref And Which Is Default ?
Answer»
ByRef: If you pass an argument by REFERENCE when calling a procedure the procedure access to the ACTUALVARIABLE in MEMORY. As a result the variable's value can be changed by the procedure.
ByVal: If you pass an argument by value when calling a procedure the variable's value can be changed with in the procedure only outside the actual value of the variable is retained.
ByRef is default: Passing by reference is the default in VBA. If you do not explicitly specify to pass an argument by value VBA will pass it by reference.