If I just type the code of the sub procedure inside the function, it works, something like: Function myFu ...
stackoverflow.com