C
c1802362
I have two subroutines in a VBA module, "uno" and "duo". Uno calls sub
duo which put the results of calculations into an array. I want to
pass the array intact back to the main sub uno. Every attempt I've
tried results in an empty array. I don't believe I can use a function
call for sub duo as functions won't return arrays.
I'm also dimensioning the array in both subs even with the public
call.
Any suggestions? A notional code snippet is below:
Option Base 1
*********************
Public Sub Uno()
Dim TempArray(100,2), i as Integer
….code…..
Call duo
For i = 1 To 100
Cells(i, 1) = TempArray(i, 1)
Cells(i, 2) = TempArray(i, 2)
Next i
….More code ….
***********************************
Public Sub duo()
Dim TempArray(100,2), i as Integer
For i = 1 To 100
TempArray(i, 1) = function1
TempArray(i, 2) = function2
Next i
End Sub
Art
duo which put the results of calculations into an array. I want to
pass the array intact back to the main sub uno. Every attempt I've
tried results in an empty array. I don't believe I can use a function
call for sub duo as functions won't return arrays.
I'm also dimensioning the array in both subs even with the public
call.
Any suggestions? A notional code snippet is below:
Option Base 1
*********************
Public Sub Uno()
Dim TempArray(100,2), i as Integer
….code…..
Call duo
For i = 1 To 100
Cells(i, 1) = TempArray(i, 1)
Cells(i, 2) = TempArray(i, 2)
Next i
….More code ….
***********************************
Public Sub duo()
Dim TempArray(100,2), i as Integer
For i = 1 To 100
TempArray(i, 1) = function1
TempArray(i, 2) = function2
Next i
End Sub
Art