spurs
Active Member
- Joined
- Oct 18, 2006
- Messages
- 479
- Office Version
- 2016
- 2013
- 2010
- 2007
- 2003 or older
- Platform
- Windows
I am trying to get the syntax right on creating either a subroutine or a function which relys on multiple inputs and can give 2 or more outputs
My function or subroutine should be called Formdata
and has the following inputs coming from the main routine
d
alpha_t
rfbr
df
In my function or subroutine i calculate 2 outputs named
Rf
theta
all values are decimal values
1) should i use a subroutine or function ?
2) What should the syntax look like for the function or subroutine including dim statements if any
3) Does the subroutine or function just simply have a value of Rf and theta calculated or do they need to be named something else?
How do i pull theta and Rf back into the main routine for further use ?
For simplicity the main part of the subroutine or function will simply be
Function Formdata - but i am not sure what follows to differentiate inputs and outputs
Dim d, alpha_t, rfbr, df as variant
Rf=d * sin(alpha_t)
theta =Atn ( rfbr * df)
End function
My function or subroutine should be called Formdata
and has the following inputs coming from the main routine
d
alpha_t
rfbr
df
In my function or subroutine i calculate 2 outputs named
Rf
theta
all values are decimal values
1) should i use a subroutine or function ?
2) What should the syntax look like for the function or subroutine including dim statements if any
3) Does the subroutine or function just simply have a value of Rf and theta calculated or do they need to be named something else?
How do i pull theta and Rf back into the main routine for further use ?
For simplicity the main part of the subroutine or function will simply be
Function Formdata - but i am not sure what follows to differentiate inputs and outputs
Dim d, alpha_t, rfbr, df as variant
Rf=d * sin(alpha_t)
theta =Atn ( rfbr * df)
End function