View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jag Man Jag Man is offline
external usenet poster
 
Posts: 38
Default Transferring ranges to/from arrays

Alan,

Yea! Application.Transpose(outArgs) does the trick. Thanks!

Ed

"Alan Beban" wrote in message
...
In my test Module I have the Option Base 1 Statement effective, so the
first line of my code is equivalent to Dim arr(1 to 3); In your Module
you do not have the Option Base 1 Statement effective, so your code is
equivalent to Dim arr(0 to 3).

As to the second point, which also answers your post of 1:24 pm, the
array is one-dimensional and "horizontal"; therefore, to transfer it to
a vertical range you might use

Range("A10:A12").Value = Application.Transpose(arr)

Alan Beban

Jag Man wrote:
Alan,

When I execute your example below I get 0, 1, 2 in the specified range.
Curiously,
if I change the range to "A10:A12" I get 1, 1, 1 in the specified range!

What is going on here, I wonder?


Ed


The following works:

Sub testIt()
Dim arr(3) As Long
arr(1) = 1
arr(2) = 2
arr(3) = 3
Range("A1:C1").Value = arr
End Sub

Alan Beban