VBA returning error when calling a Sub with multiple parameters

后端 未结 1 1874
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-06 05:15

I\'m trying to figure out why VBA is returning an error (Compile error: Expected: =)when I call a Sub and supply it with multiple para

相关标签:
1条回答
  • 2020-12-06 05:29

    When calling more than 1 parameter (i.e. just generateURL(n) works) you need to either use

    • Call generateURL(n, firstCol) , or
    • generateURL n, firstCol

    using Call is the better programming technique as it is clearer

    As per MSDN:

    You normally use the Call statement to call a procedure that does not return a value. If the procedure returns a value, the Call statement discards it. You are not required to use the Call statement when calling a procedure. However, it improves the readability of your code.

    0 讨论(0)
提交回复
热议问题