Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there,
I have the following code (its simplified). I want to pass a value to a routine and for it to be doubled. I thought by using ByRef it would come back to the oriingal routine changed but I must be missing something. I have an example below. I get 100 instead of 200 at the end of the Test procedure. What am I doing Wrong. Any help greatly appreciated. Tx Suzanne Sub Test Dim y y =100 Call Test2(y) Debug.Print y End Sub Sub Test2( ByRef x) x = x *2 End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Application.run and ByRef arguments | Excel Programming | |||
ByRef strangeness | Excel Programming | |||
byref errors | Excel Programming | |||
ByRef question | Excel Programming | |||
Is ByVal always better if ByRef isn't necessary | Excel Programming |