LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 921
Default VBA - Function Output

Hi,

I posted this question earlier but I think I was unclear.

I am trying to use a function (maybe it is technically a macro - I dont
know)- here is my problem.

The function has 3 "input" variables declared as doubles, and based on these
values the function assigns values to 3 output "variables". The output
variables are declared inside the function - so I just want to get them -
without declaring global variables.

So in the code below I want to get variables "var1, var2, var3" - since they
are the result of the TestFunction.


Sub MainTest()
Dim get1 As Double
Dim get2 As Double
Dim get3 As Double

Call TestFunct1(1, 2, 3)

End Sub

Sub TestFunct1(X, Y, Z)
Dim var1 As Double
Dim var2 As Double
Dim var3 As Double

var1 = 1 * X
var2 = 2 * Y
var3 = 3 * Z

End Sub

Thanks for your help.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use function output as a cell reference Nigel Excel Worksheet Functions 2 February 8th 07 02:14 PM
How can I output VBA function results (array's for example) to spreadsheet [email protected] Excel Worksheet Functions 2 January 11th 07 05:49 PM
Reverse output of the Linest function Nick Flyger Excel Worksheet Functions 2 October 2nd 06 08:02 AM
Function/ formula to output a cell reference Creator Excel Worksheet Functions 19 February 17th 06 06:39 PM
Excel should have a function to output T Stat Stat Excel Worksheet Functions 0 June 30th 05 03:25 PM


All times are GMT +1. The time now is 10:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"