Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you pass them byRef, then if you change them in the function they are
changed in the calling routine. If you pass them byVal then they are not. byRef is the default and if you don't specify byVal specifically, then they are passed byRef. Sub Macro1() A = 1 B = 2 C = 3 MsgBox "A=" & A & vbNewLine & _ "B=" & B & vbNewLine & _ "C=" & C & vbNewLine Macro2 A, B, C MsgBox "A=" & A & vbNewLine & _ "B=" & B & vbNewLine & _ "C=" & C & vbNewLine End Sub Sub Macro2(AA, BB, CC) AA = AA + 10 BB = BB / CC CC = CC / BB End Sub as an example -- Regards, Tom Ogilvy Gaston wrote in message ... Sorry to bother you guys again, but another question has popped up. Simple one, but I'm just wondering, if I pass 3 integers into a function and change the values of all three... when i return to my main function... do the values of the changed integers remain the same? If not, how can I make the function do this? Thanks once again. --- Message posted from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Passing parameters Cel Ref) to Sum function | Excel Discussion (Misc queries) | |||
Passing parameters | Excel Programming | |||
Passing parameters to UDF | Excel Programming | |||
Passing Parameters to Userdefined Functions | Excel Programming | |||
Passing Parameters through OnAction | Excel Programming |