I think I might have an easy question for people who have programmed with VBA before. I just started (about 2 hours ago) programming with VBA. I know other coding languages. And here's my problem, I wanted to write a user-defined function, that compartmentalized a common task and it required no arguments. So for example:
Easy enough. But when I put a call to this function, like so:
VBA returns a general error telling me I'm wrong.
Now, I changed all this to
and the call as such:
and voila! it worked. Am I missing something? Do I have to include some null or void keyword indicating I don't want to pass anything? I feel that I shouldn't have to pass a variable through.
Also, if you know of any good online VBA tutorials, I would be more than happy to read it. Thanks a lot in advance.
Kevygee
Code:
Function commonTask()
do.Common.stuff
End Function
Easy enough. But when I put a call to this function, like so:
Code:
commonTask()
Now, I changed all this to
Code:
Function commonTask(dummyString as String)
do.Common.stuff
End Function
and the call as such:
Code:
commonTask("dummyString")
and voila! it worked. Am I missing something? Do I have to include some null or void keyword indicating I don't want to pass anything? I feel that I shouldn't have to pass a variable through.
Also, if you know of any good online VBA tutorials, I would be more than happy to read it. Thanks a lot in advance.
Kevygee