I am trying to pass three variables to a function. In the sub I dim each as
a string, I set them to the appropriate value then I use the the next line
to call the function Test1. The variables are of course V1,V2,V3.
Test1(V1,V2,V3)
Function Test1(str2 As String, str3 As String, str4 As String)
code
End Function
If I use just one variable to pass it works fine. When I try to put 3 to
pass, that is to say when I put in the V2 and V3 in the calling statement I
get an error telling me a = is Expected. ("Expected: =") I assume one can
pass multiple variables to a function. Can someone enlighten me.
Thanks
Paul Overway - 09 May 2005 20:48 GMT
Remove the parens...
Test1 V1,V2,V3

Signature
Paul Overway
Logico Solutions
http://www.logico-solutions.com
>I am trying to pass three variables to a function. In the sub I dim each as
>a string, I set them to the appropriate value then I use the the next line
[quoted text clipped - 11 lines]
> can pass multiple variables to a function. Can someone enlighten me.
> Thanks
Klatuu - 09 May 2005 22:01 GMT
The parens are not the problem, I don't think. If I take your post literally
and the = Expected error is what you are getting, then you are not assigning
the value returned by Test1 to anything. Try:
WhateverKindofDataIExpect = Test1(V1,V2,V3)
> I am trying to pass three variables to a function. In the sub I dim each as
> a string, I set them to the appropriate value then I use the the next line
[quoted text clipped - 11 lines]
> pass multiple variables to a function. Can someone enlighten me.
> Thanks
Paul Overway - 09 May 2005 22:18 GMT
Yes...the parens are the problem. He either needs to exclude them, use
Call, or assign the function return to something.

Signature
Paul Overway
Logico Solutions
http://www.logico-solutions.com
> The parens are not the problem, I don't think. If I take your post
> literally
[quoted text clipped - 23 lines]
>> pass multiple variables to a function. Can someone enlighten me.
>> Thanks
Paul Overway - 09 May 2005 22:25 GMT
A simple test...in your immediate window
Right("whatever",1)
Then try...
Right "whatever",1

Signature
Paul Overway
Logico Solutions
http://www.logico-solutions.com
> The parens are not the problem, I don't think. If I take your post
> literally
[quoted text clipped - 23 lines]
>> pass multiple variables to a function. Can someone enlighten me.
>> Thanks