Dear all,
I have a function that returns a 7x2 array.
I would like to have this array fully displayed in the neighboring cells.
I'm aware of the combo Formula+SelectRange+F2+Ctrl-Shift-Enter, but afterwards this doesn't allow me to modify seperately each cell ('You can't change part of an array').
Also, it's really tedious to 'explore' the array with the INDEX function.
I'm aware of the rule, that a UDF cannot modify cells outside the calling cell. So the solution could be calling a Sub routine.
Something like that:
Sub PutOutput(ByRef oRange, ByRef Data)
Dim nR As Long
Dim nC As Long
nR = Data.Rows.Count
nC = Data.Columns.Count
Dim R, C
For R = 0 To nR
For C = 1 To nC
oRange.Offset(R, C).Value = Data(R, C)
Next
Next
End Sub
With something like that in the function:
Set myRange = Range(ActiveCell)
Call PutOutput(myRange, myArray)
But something is bogus somewhere, and I cannot figure why.
Thanks for your help!
Bookmarks