Hi forum,
I m new to vba.I had seen many functions on net about By val & By Ref parameters in a functions and procedure.I want to Know when these are used and how to use them.please post any examples explaining the above parameters.
Thanks.
Hi forum,
I m new to vba.I had seen many functions on net about By val & By Ref parameters in a functions and procedure.I want to Know when these are used and how to use them.please post any examples explaining the above parameters.
Thanks.
if you pass a parameter byval you pass a copy of the variable which your called code can manipulate without affecting the original variable. if you pass it byref you pass a pointer to the original variable and any changes made to the variable affect the original variable as well. if your parameter is an object and you pass it byval you actually pass a copy of the pointer so changes will affect the original object but you cannot change which object the variable refers to
which to use depends on the situation but the default is byref if your code does not specify byval
Josie
if at first you don't succeed try doing it the way your wife told you to
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks