I'm confused about the different ways of calling functions or subs.
[VBA]
Sub addOne(ByRef num As Long)
num = num + 1
End Sub
Sub test()
Dim num As Long
num = 10
addOne num
addOne (num)
End Sub
[/VBA]
The two different ways of calling the sub results to a different behaviour. The first one results in incrementing the num variable defined in the test sub. The second one doesn't.
Then there would be a third way: Call addOne (num)
What's the difference of these different ways? How do I know what to use?
This really bothers me a lot so any help is appreciated!
Thanks!