> Variable Var should become 2, isn't it?
> Is there a restriction in VBA or I don't know how to use.
Remove the parens in your call to Apelat and everything will work as
exepcted. This is a case of VB/A's flexibility getting in the way.
Consider this:
Apelat Var
Call Apelat(Var)
Both yield the same result. However, this does not:
Apelat (Var)
When you surround a parameter with parens and don't use the Call
keyword, VB/A passes a copy of that parameter. So even though you
specified the parameter is to be pass ByRef, you're essentially passing
ByVal as the copy is sent and modified, leaving the original untouched.
--
There are 10 kinds of people. Those who understand binary and those who
don't.
http://code.acadx.com
(Pull the pin to reply)