Vba call subroutine with arguments

Vba call subroutine with arguments

Author: fci On: 29.06.2017

And I get syntax errors. Modifying the sub to only take one argument and leaving out the 3 gives no errors, the problem is only when I have 2 arguments.

Excel VBA - Passing Argument Parameter to Sub - Stack Overflow

When there is not any , between and , VBA thinks it's a formula and exactly one argument. By posting your answer, you agree to the privacy policy and terms of service. Stack Overflow Questions Developer Jobs Documentation beta Tags Users.

Passing Arguments to Procedures

Sign up or log in to customize your list. Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us. Log In Sign Up. Join the Stack Overflow Community. Stack Overflow is a community of 7.

Excel VBA Programming - Passing values to a Subroutine

Join them; it only takes a minute: Using VBA with Access , I have a sub: Public Sub setInterest account As String, dmonth As Integer End Sub And I am calling it with setInterest "myAccount",3 And I get syntax errors.

This issue has been answered multiple times already. When using multiple arguments, you can either write: Spent two hours struggling with that.

vba call subroutine with arguments

I add this answer, for Why your syntax works with one argument? Public Sub setInterest account As String ' End Sub setInterest "myAccount" Note: When formula calculate the result will be like this: Sign up or log in StackExchange.

Sign up using Facebook. Sign up using Email and Password.

Post as a guest Name. Stack Overflow works best with JavaScript enabled.

Don't know if there is something more weird in the face of the whole Earth! MathOverflow Mathematics Cross Validated stats Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more 3.

vba call subroutine with arguments

Meta Stack Exchange Stack Apps Area 51 Stack Overflow Talent.

inserted by FC2 system