Try it in a normal module. Apparently it isn't working the way it is, where it is.
As a general rule, I try to keep code out of an object's module unless it needs to be there.
You also might try declaring the argument.
By the way,
you should precede your lines of code with [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code]
When you see this in the edit window:
[code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code]
This is what it looks like on the board
Bookmarks